Skip to content

janfreyberg/testver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

testver

PyPI version

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 <package>.__version__ variable).

This works well with systems such as flit, that require versions to be specified in the code.

Usage:

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).

testver src/

For an example on how to use this in a continuous integration system, see the workflow file of this repository.

About

Programmatically edit python package versions for testing.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages