Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janfreyberg/testver
Programmatically edit python package versions for testing.
https://github.com/janfreyberg/testver
Last synced: about 2 months ago
JSON representation
Programmatically edit python package versions for testing.
- Host: GitHub
- URL: https://github.com/janfreyberg/testver
- Owner: janfreyberg
- License: mit
- Created: 2020-05-03T14:31:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-31T20:47:07.000Z (over 3 years ago)
- Last Synced: 2024-11-13T09:17:32.862Z (about 2 months ago)
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# testver
[![PyPI version](https://badge.fury.io/py/testver.svg)](https://badge.fury.io/py/testver)
*Programmatically edit python package versions for testing.*
When publishing a python package from a continuous integration system, it can
be useful to publish it to a test package repository such as test.pypi.org.However, package repositories only accept a certain version of a package once.
To get around this, this package edits the python version in your python code
(defined as the `.__version__` variable).This works well with systems such as flit, that require versions to be
specified in the code.## Usage:
```bash
testver src/ --dryrun
```This will print out all the changes the script would make. It goes through the
directory you pass, and searchers for python files called `__init__.py` or
`__version__.py` (common ways of naming the files in which version numbers
are specified).Once found, if `--dryrun` is not specified, it will modify the python source
code. **Make sure you can easily revert this locally if you are testing**
(i.e. commit changes before you run this).```bash
testver src/
```For an example on how to use this in a continuous integration system, see
the
[workflow file](https://github.com/janfreyberg/testver/blob/master/.github/workflows/test.yml#L39#L52)
of this repository.