Skip to main content
File added late

1 file was added to this release more than 14 days after its initial publication. Inspect the release files before installing.

Pre-release

This release is a pre-release and may not be stable for production use.

Polyversion: derive subproject versions from tags on Git monorepos

version:

0.2.2a1

updated:

2018-08-07T13:30:07.616687

Documentation:

http://polyvers.readthedocs.io/en/latest/usage-pvlib.html

repository:

https://github.com/JRCSTU/polyvers

pypi-repo:

https://pypi.org/project/polyversion/

copyright:

2018 JRC.C4(STU), European Commission (JRC)

license:

MIT License

The python 2.7+ library needed by (sub-)projects managed by polyvers cmd to derive their version-ids on runtime from Git.

Specifically, the configuration file .polyvers.yaml is NOT read - you have to repeat any non-default configurations as function/method keywords when calling this API.

Here only a very rudimentary documentation is provided - consult polyvers documents provided in the link above.

Quickstart

There are 4 ways to use this library:
  • As a setuptools plugin;

  • through its Python-API (to dynamically version your project);

  • through its barebone cmdline tool: polyversion (installation required);

  • through the standalone executable wheel: bin/pvlib.run (no installation, but sources required; behaves identically to polyversion command).

setuptools usage

currentmodule: polyversion

The polyversion library function as a setuptools “plugin”, and adds two new setup() keywords for deriving subproject versions from PKG-INFO or git tags (see func(polyversion.init_plugin_kw)):

  1. keyword: polyversion --> (bool | dict)

    When a dict, its keys roughly mimic those in func(polyversion()), and can be used like this:

    from setuptools import setup
    
    setup(
        project='myname',
        version=''              # omit (or None) to abort if cannot auto-version
        polyversion={           # dict or bool
            'mono_project': True, # false by default
            ...  # See `polyversion.init_plugin_kw()` for more keys.
        },
        setup_requires=[..., 'polyversion'],
        ...
    )
  2. keyword: polyversion_check_bdist_enabled --> bool

    When it is true, the bdist-check is enabled, and any bdist_* setup-commands (e.g. bdist_wheel) will abort if not run from engraved sources (ie from an release tag).

    To enable this check without editing the sources, add the following into your $CWD/setup.cfg file:

    [global]
    polyversion_check_bdist_enabled = true
    ...

API usage

An API sample of using also func(polytime()) from within your myproject.git/myproject/__init__.py file:

from polyversion import polyversion, polytime  # no hack, dependency already installed

__version__ = polyversion()  # project assumed equal to this module-name: 'myproject'
__updated__ = polytime()
...

Console usage

The typical command-line usage of this library (assuming you don’t want to install the full blown polyvers command tool) is given below:

user@host:~/ $ polyversion --help
Describe the version of a *polyvers* projects from git tags.

USAGE:
    polyversion [PROJ-1] ...
    polyversion [-v | -V ]     # print my version information

user@host:~/ $ polyversion polyversion    # fails, not in a git repo
b'fatal: not a git repository (or any of the parent directories): .git\n'
  cmd: ['git', 'describe', '--match=cf-v*']
Traceback (most recent call last):
  File "/pyenv/site-packages/pvlib/polyversion/__main__.py", line 18, in main
    polyversion.run(*sys.argv[1:])
  File "/pyenv/site-packages/pvlib/polyversion/__init__.py", line 340, in run
    res = polyversion(args[0], repo_path=os.curdir)
  File "/pyenv/site-packages/pvlib/polyversion/__init__.py", line 262, in polyversion
    pvtag = _my_run(cmd, cwd=repo_path)
  File "/pyenv/site-packages/pvlib/polyversion/__init__.py", line 106, in _my_run
    raise sbp.CalledProcessError(proc.returncode, cmd)
subprocess.CalledProcessError: Command '['git', 'describe', '--match=cf-v*']' returned non-zero exit status 128.

user@host:~/ $ cd polyvers.git
user@host:~/polyvers.git (dev) $ polyversion polyvers polyversion
polyvers: 0.0.2a10
polyversion: 0.0.2a9

Standalone wheel

Various ways to use the standalone wheel from bash (these will still work without having installed anything):

user@host:~/polyvers.git (master) $
user@host:~/polyvers.git (master) $ ./bin/pvlib.run polyversion
polyversion: 0.0.2a9
user@host:~/polyvers.git (master) $ python ./bin/pvlib.run --help
...
user@host:~/polyvers.git (master) $ python ./bin/pvlib.run -m polyversion  -v
version: 0.0.2a9
user@host:~/polyvers.git (master) $ PYTHONPATH=./bin/pvlib.run  python -m polyversion  -V
version: 0.0.2a9
updated: Thu, 24 May 2018 02:47:37 +0300

For the rest, consult the polyvers project: https://polyvers.readthedocs.io

Metadata

Release files for polyversion 0.2.2a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Source distribution (sdist)

Source distribution for polyversion 0.2.2a1
File Size Uploaded Provenance Actions
polyversion-0.2.2a1.tar.gz 19.5 kB File added late: Without provenance Details for polyversion-0.2.2a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polyversion 0.2.2a1
File Interpreter ABI Platform Actions
polyversion-0.2.2a1-py2.py3-none-any.whl Python 2, Python 3 none any Details for polyversion-0.2.2a1-py2.py3-none-any.whl

Total release size: 40.9 kB

Release files / polyversion-0.2.2a1.tar.gz

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL polyversion-0.2.2a1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4f9fb8da12bfe0ac35ed5670a9193808da1e6c7fc7a610ff5b87d55ad365d3c1
BLAKE2b-256 checksum
How to use checksums
2dd543e0b2311f96900a0c9fee0631a6441925ec7323bbc638b80d2c02553c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

Release files / polyversion-0.2.2a1-py2.py3-none-any.whl

Download URL polyversion-0.2.2a1-py2.py3-none-any.whl
Size 21.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1ac8cbc2edc023938fb6403c2f6488118bc7a02fb70cac67ad7d0ba62c53bf79
BLAKE2b-256 checksum
How to use checksums
f64b329eb987fd3fda27dbdf226942be2fe48b5443dbe9d5071183f1a37f6038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.1

Security for polyversion 0.2.2a1

Upload timing

File added late

1 file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.


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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page