Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-RA-King committed Sep 4, 2022
1 parent 7a3de5a commit c2e1d0c
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# piptools-sync

---

> A pre-commit plugin to align pre-commit repository versions with those derived by pip-tools..
[![PyPI][pypi-image]][pypi-url]
Expand Down Expand Up @@ -27,15 +29,17 @@
[![DeepSource][deepsource-image]][deepsource-url]
[![license][license-image]][license-url]

[**pip-tools**][pip-tools-url] and [**Pre-Commit**][pre-commit-url] are two of my favourite developer tools. However, they don't necessarily agree
[**pip-tools**][pip-tools-url] and [**Pre-Commit**][pre-commit-url] are two of my favourite development tools. However, they don't necessarily agree
on what versions of packages should be installed.
This lack of consolidation can lead to problems with pre-commit.
This pre-commit plugin syncs the pre-commit package versions with the versions generated by the pip-tools compile process.
This pre-commit plugin syncs the pre-commit package versions with the versions generated by pip-tools' compile process.

![](assets/header.png)

## Introduction

---

### Project Rationale

A while ago I came across an issue committing files to my local git repository. The issue occured at the flake8 linting stage using pre-commit.
Expand All @@ -46,7 +50,7 @@ With further investigation I noticed that pip-tools had pinned flake8 to an earl
In short - pip-tools does a spectacularly good job pinning packages and package dependencies. It has one job to do and it does it very well. The pre-commit autoupdate command just updates the "rev" for the "repo" in the
.pre-commit-config.yaml file.

Comparing the two ways the configurations are stored:
The following example displays the way flake8 and a few plugins are configured by the two tools :

- pip-tools (via requirements.txt)

Expand Down Expand Up @@ -104,6 +108,8 @@ https://github.com/jazzband/pip-tools/issues/1437

## Installation

---

### 1 - Install into pre-commit

Just add to the pre-commit configuration file (.pre-commit-config.yaml).
Expand All @@ -116,25 +122,27 @@ I have configured it to run at every commit at the pre-commit stage of git.
- id: piptools_sync
```

### 2 - Install into site-packages
### 2 - Install by pip

Installing by pip enables the package to be run from the command line at any time
Installing by pip enables the package to be run from the command line at any time.

```sh
pip install piptools-sync
```

## Usage example
## Usage

---

### 1 - Automatic running by pre-commit

Passing example
Passing example.

```shell
piptools_sync............................................................Passed
```

Failing example
Failing example.

```shell
piptools_sync............................................................Failed
Expand All @@ -150,14 +158,14 @@ However, the commit with fail and will need to be re-run.

### 2 - Running from the command line

Passing example
Passing example.

```shell
$ piptools_sync
INFO:init:Success! - pre-commit is in sync with piptools
```

Failing example
Failing example.

```shell
$ piptools_sync
Expand All @@ -170,14 +178,31 @@ _For more examples and usage, please refer to the [Wiki][wiki]._

## Documentation

---

### - [**Read the Docs**](https://piptools-sync.readthedocs.io/en/latest/)

### - [**Wiki**](https://github.com/Stephen-RA-King/piptools-sync/wiki)

## Future Enhancements

---

- Move some global variables into a separate settings file (toml).
- Settings configurable from the command line.
- Improve web request performance with aiohttp library.
- increase indentation on yaml write.

## Known Issues

---

- Fix failing tests

## Meta

---

[![](assets/linkedin.png)](https://linkedin.com/in/stephen-k-3a4644210)
[![](assets/github.png)](https://github.com/Stephen-RA-King)
[![](assets/pypi.png)](https://pypi.org/project/piptools-sync/)
Expand Down

0 comments on commit c2e1d0c

Please sign in to comment.