Extracts the version from a Python file
Project description
A tool for extracting the version of a Python file.
Features
Extract the value from a version field inside any Python file
Documentation
Documentation sources are included with the project, and used to generate the documentation sites:
The latest docs are always generated for the latest release, kept in the ‘master’ branch
The development docs are generated from the latest code in the ‘develop’ branch
You can also create the documentation from the source files, kept in the ‘docs’ folder, with the help of Sphinx. For this use the makefile, or the make.bat file, contained on that folder.
Prerequisites
The project has been tested in the following versions of the interpreter:
Python 3.4
Python 3.5
Python 3.6
Pypy 3
All other dependencies are indicated on the requirements.txt file.
These can be installed with:
$ pip install --upgrade -r requirements.txt
Installing
The project is offered as a Pypi package, and using pip is the preferred way to install it. For this use the following command;
$ pip install bernardomg.version-extractor
If needed, manual installation is possible:
$ python setup.py install
Usage
Just import and use the function:
from version_extractor import extract_version version = extract_version('tests/resources/__init__.py')
Or use a preconfigured function:
from version_extractor import extract_version_init version = extract_version_init('tests/resources')
This is useful when setting up a setup.py file:
setup( ... version=extract_version_init(_source_package), ... )
Testing
The tests included with the project can be run with:
$ python setup.py test
This will delegate the execution to tox.
It is possible to run just one of the test profiles, in this case the py36 profile:
$ python setup.py test -p "py36"
Collaborate
Any kind of help with the project will be well received, and there are two main ways to give such help:
Reporting errors and asking for extensions through the issues management
or forking the repository and extending the project
Issues management
Issues are managed at the GitHub project issues tracker, where any Github user may report bugs or ask for new features.
Getting the code
If you wish to fork or modify the code, visit the GitHub project page, where the latest versions are always kept. Check the ‘master’ branch for the latest release, and the ‘develop’ for the current, and stable, development version.
License
The project has been released under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for bernardomg.version_extractor-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d51791e457229ab807cecb28cfb0a4930338f788fe5db39df5c7f94067f12ea6 |
|
MD5 | 8701f62a7b47777661e2edee1c52ca0b |
|
BLAKE2b-256 | 9bdbca16f448a481b0579c6f67b0082b0c831b19bbd77dfc9498c407c6faeb09 |
Hashes for bernardomg.version_extractor-1.0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7eb38a413f8bdf9231778a8f5ca6126f947d1e9499687a69c4be9253fc8bbc39 |
|
MD5 | 7b8159058df2295465b3ea9d05ee393b |
|
BLAKE2b-256 | 6008c70598299717b80498d9fa780b2b50e30ec4420c6e9f442fc92e9587ce4e |