--------------
Single module python package to make versioning simple. You add a couple of
configuration parameters to your top-most python module and ``whatsmyversion`` will
determine the version string based on your git history.
Using ``whatsmyversion``
~~~~~~~~~~~~~~~~~~~~
Add the following to the top level of your package (package_name/__init__.py
or single_module_package.py) ::
import whatsmyversion
__version__ = whatsmyversion.version(__file__)
del whatsmyversion
Add the following to your setup.py ::
import package_name
setup = (
version = package_name.__version__
...
)
Aaaaand that's it! ::
python -c "import package_name; print(package_name.__version__)"
For example, look at the ``setup.py`` and ``whatsmyversion.py`` of this project for
guidance in setting up your own project! ::
$ python -c "import whatsmyversion; print(whatsmyversion.__version__)"
v0.0.2.post6+g32c6562
Configuring ``whatsmyversion``
~~~~~~~~~~~~~~~~~~~~~~~~~~
There are a few configuration options that you can provide to the `version`
function. These are:
``version_prefix`` which is defaults to ``v``
``version_suffix`` which is one of ``a``, ``b``, ``rc``, ``.post``, ``.dev``
and defaults to ``.post``
``use_local_version_id`` which is a boolean flag to include (True) or not
(False) the git hash and defaults to ``True`` because information is power
These three configuration options combine to produce a PEP440 compliant
version string. `PEP440 <https://www.python.org/dev/peps/pep-0440/>`_
Use cases
~~~~~~~~~
Working:
* Determine the version of a git repository
* Installed with ``setup.py develop``
* Installed with ``setup.py install``
Not yet working:
- Determine the version of source code downloaded from github
Metadata
Release files for whatsmyversion 0.0.5.post3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| whatsmyversion-0.0.5.post3.tar.gz | 4.4 kB | Without provenance | Details for whatsmyversion-0.0.5.post3.tar.gz |
Release files / whatsmyversion-0.0.5.post3.tar.gz
| Download URL | whatsmyversion-0.0.5.post3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29aac2945b2e64ca81970afceab3fca6a8711b065552c3ac2fd20f8c1509a817
|
|
BLAKE2b-256 checksum How to use checksums |
14d55a78190e58391e0233d78af309b4a036470c82c4461c166c46d24fe1d525
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for whatsmyversion 0.0.5.post3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.