Skip to content

Commit

Permalink
opt string reworded and README.md updated
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeyret committed Apr 16, 2019
1 parent 783ee19 commit 2897268
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
9 changes: 9 additions & 0 deletions HISTORY.rst
Expand Up @@ -26,3 +26,12 @@ History
------------------

* fixed packaging errors for README and version


0.2.0 (2019-04-16)
------------------

* added `pipstripper` cli mode.
* swapped --scan option for the more explicit --noscan
* added more docstrings
* README.md changes
19 changes: 13 additions & 6 deletions README.md
Expand Up @@ -20,15 +20,17 @@ For example, let's say that you have installed `black 18.9b0`. A linter and aut
# How it works

````
usage: _pip_stripper.py [-h] [--config CONFIG] [--scan] [--build] [--init]
usage: pipstripper [-h] [--config CONFIG] [--noscan] [--build] [--init]
[--workdir WORKDIR] [--verbose]
optional arguments:
-h, --help show this help message and exit
--config CONFIG config - will look for pip-stripper.yaml in --workdir,
current directory
--scan scan scan python files and classify packages [True]
--build build [False]
--noscan noscan don't scan to classify packages --build will re-
use existing pip-stripper.scan.yaml. [False].
--build build - read pip-stripper.scan.yaml to create
requirements.prod/dev.txt [False]
--init init initialize the config file if it doesn't exist
--workdir WORKDIR workdir [defaults to config's value or current directory]
--verbose verbose [False]
Expand All @@ -37,14 +39,14 @@ optional arguments:
## Three phases, `initialization`, `scan` and `build`.


### Initialization
### Initialization (defaults to False)

The first option `--init` will create **pip-stripper.yaml**, the configuration file for pip-stripper.

**This is the only file you should edit manually!!!**


### Scan
### Scan (defaults to True)

The second option, `--scan`, will scan your Python source files in `--workdir` and use it to create **pip-stripper.scan.yaml**.

Expand All @@ -59,13 +61,18 @@ Instead:
`--scan` also creates 2 work files, `tmp.pip-stripper.freeze.rpt` and `tmp.pip-stripper.imports.rpt`, tracking pip packages and its best guesses at python imports, respectively.


### Build.
### Build (defaults to False)

`--build` will take what it found in **pip-stripper.scan.yaml** and use it to populate
`requirements.prod.txt` and `requirements.dev.txt`.

If you don't agree with what's in those requirements files, you may need to edit **pip-stripper.yaml**.

####So, for example, you could initialize, scan and build in your current python directory with:

`pipstripper --init --build`


## Editing `pip-stripper.yaml`

This allows you to specify:
Expand Down
2 changes: 1 addition & 1 deletion pip_stripper/_pip_stripper.py
Expand Up @@ -271,7 +271,7 @@ def getOptParser(cls):
"--" + dest,
default=default,
action="store_true",
help="%s don't run scan to classify packages [%s]. build re-uses existing pip-stripper.scan.yaml"
help="%s don't scan to classify packages --build will re-use existing pip-stripper.scan.yaml. [%s]. "
% (dest, default),
)

Expand Down

0 comments on commit 2897268

Please sign in to comment.