You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a lower bound checker to be invoked on the command line by client libraries. This accomplishes two things:
- Makes it easier to mass update/create constraints files.
- Adds another layer of checks to the lower bounds in setup.py / constraints files.
See googleapis/synthtool#869 for additional context on the lower bounds work.
`lower-bound-checker` is intentionally restrictive on the types of pins it permits in `setup.py` and `constraints.txt`. The tool doesn't try to `pip install` the package. It is assumed that other checks (e.g., setup.py lint, unit tests) will pick up on things like misspelled package names or a version range that cannot be fulfilled.
```
busunkim@busunkim:~/github/python-test-utils$ lower-bound-checker check --help
Usage: lower-bound-checker check [OPTIONS]
Check that the constraints-file pins to the lower bound specified in
package-name's setup.py for each requirement.
Requirements:
1. The setup.py pins every requirement in one of the following formats:
* foo==1.2.0
* foo>=1.2.0
* foo>=1.2.0, <2.0.0dev
* foo<2.0.0dev, >=1.2.0
2. The constraints file pins every requirement to a single version:
* foo==1.2.0
3. package-name is already be installed in the environment.
Options:
--package-name TEXT Name of the package. [required]
--constraints-file TEXT Path to constraints file. [required]
--help Show this message and exit.
```
**Example Usage:**
(for reviewers)
- Install this repo from source: `pip install /path/to/repo`
- Install another package from source: `pip install /path/to/google-cloud-foo`
1. Check an existing package and constraints file:
```
lower-bound-checker check --package-name google-cloud-foo
--constraints-file testing/constraints-3.6.txt
```
2. Create/update a constraints file:
```
lower-bound-checker update --package-name google-cloud-foo
--constraints-file testing/constraints-3.6.txt
```
0 commit comments