Name | ci-helper JSON |
Version |
0.3.0
JSON |
| download |
home_page | None |
Summary | Get info on how a package should be built on CI |
upload_time | 2024-12-03 23:02:35 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Christopher Billington Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
build
setuptools
ci
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ci-helper
Output information to help build a Python package in CI
## Motivation
This tool exists to address certain issues of bit-rot and deployment of GitHub Actions
workflows (though the problem exists for CI generally) that build Python packages.
It looks up what current Python versions are supported so you can target them in your
builds without having to maintain a curated list. It determines whether building on
multiple OSs or Python versions is needed for a Python package, allowing you to deploy a
generic CI configuration for different types of packages without having to modify it for
each one specifically when they only vary in this way.
Specifically:
* It lists all stable and supported Python versions so your CI can target all supported
versions of Python without having to curate a manual list.
* It tells you what the second-most-recent minor version of Python is, so you can use that
as a sensible default for tools that require a recent-ish Python but are likely not to
work immediately after a new Python is released.
* It tells you whether a Python package is pure Python or not, so that your CI knows
whether it needs to build on multiple OSs/Python versions.
* It tells you whether a Python package's dependencies have environment markers or not, so
that your CI knows whether it needs to build on multiple OSs/Python versions, for
package formats that don't support environment markers in dependencies (e.g. conda
packages).
These functions are all serving the goals of:
* Minimising how often you need to modify your CI configs just because a new version of
Python came our or an old version reached end-of-life
* Minimising (ideally to zero) how much you need to customise an otherwise generic CI
config when you re-use it for different types of Python packages (e.g. pure vs impure)
## Installation
This package is available on PyPI, install it to your current Python environemnt with
```bash
pip install ci-helper
```
## Usage:
```bash
# All stable, non-end-of-life Python versions:
$ ci-helper pythons
3.9,3.10,3.11,3.12,3.13
# Same but in the format used by `cibuildwheel`'s `CIBW_BUILD` environment variable (cpython-only for now):
$ ci-helper pythons --cibw
cp39-* cp310-* cp311-* cp312-* cp313-*
# The second-most recent minor Python release, a good choice for the version to run
# tools from:
$ ci-helper defaultpython
3.12
# Info about the source Python project in the current working directory - name, version,
# whether it's a pure Python package, and whether its build or run requirements contain
# any # environment markers (that is, whether its requirements vary by platform or
# Python version):
$ ci-helper distinfo .
{
"name": "ci-helper",
"version": "0.1.dev1+g5043fb5.d20241202",
"is_pure": true,
"has_env_markers": false
}
# Same but one field at a time, more convenient for assigning to environment variables:
$ ci-helper distinfo name .
ci-helper
$ ci-helper distinfo version .
0.1.0
$ ci-helper distinfo is_pure .
true
$ ci-helper distinfo has_env_markers .
false
```
## Full help text
```shell
$ ci-helper -h
usage: ci-helper [-h] [--version] {pythons,defaultpython,distinfo} ...
positional arguments:
{pythons,defaultpython,distinfo}
Action to perform
pythons Output list of stable Python versions that have not yet reached end of life, see `ci-helper pythons -h`
defaultpython Output the second-latest stable Python version in X.Y format, useful as a good choice for a default python version
distinfo Output info about the distribution, see `ci-helper distinfo -h`
options:
-h, --help show this help message and exit
--version show program's version number and exit
```
```shell
$ ci-helper pythons -h
usage: ci-helper pythons [-h] [--cibw]
options:
-h, --help show this help message and exit
--cibw Output as a space-separated list in the format `cpXY-* cpXY-*` as appropriate for the CIBW_BUILD environment variable to build for all
stable CPython versions, otherwise versions are output as a comma-separated list in the format X.Y,X.Y
```
```shell
$ ci-helper default_python -h
usage: ci-helper defaultpython [-h]
options:
-h, --help show this help message and exit
```
```shell
$ ci-helper distinfo -h
usage: ci-helper distinfo [-h]
[{name,version,is_pure,has_env_markers}]
project_directory
positional arguments:
{name,version,is_pure,has_env_markers}
Name of field to output as a single json value, if not
given, all info is output as json
project_directory Directory of Python project
options:
-h, --help show this help message and exit
```
Raw data
{
"_id": null,
"home_page": null,
"name": "ci-helper",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "build, setuptools, CI",
"author": null,
"author_email": "Christopher Billington <chrisjbillington@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/4a/b9/5019a3134d72fc7a7cfa73eb04b1e48b35a8c8aa4bdb49ea836a943bbb51/ci_helper-0.3.0.tar.gz",
"platform": null,
"description": "# ci-helper\n\nOutput information to help build a Python package in CI\n\n## Motivation\n\nThis tool exists to address certain issues of bit-rot and deployment of GitHub Actions\nworkflows (though the problem exists for CI generally) that build Python packages.\n\nIt looks up what current Python versions are supported so you can target them in your\nbuilds without having to maintain a curated list. It determines whether building on\nmultiple OSs or Python versions is needed for a Python package, allowing you to deploy a\ngeneric CI configuration for different types of packages without having to modify it for\neach one specifically when they only vary in this way.\n\nSpecifically:\n\n* It lists all stable and supported Python versions so your CI can target all supported\nversions of Python without having to curate a manual list.\n\n* It tells you what the second-most-recent minor version of Python is, so you can use that\nas a sensible default for tools that require a recent-ish Python but are likely not to\nwork immediately after a new Python is released.\n\n* It tells you whether a Python package is pure Python or not, so that your CI knows\nwhether it needs to build on multiple OSs/Python versions.\n\n* It tells you whether a Python package's dependencies have environment markers or not, so\nthat your CI knows whether it needs to build on multiple OSs/Python versions, for\npackage formats that don't support environment markers in dependencies (e.g. conda\npackages).\n\nThese functions are all serving the goals of:\n\n* Minimising how often you need to modify your CI configs just because a new version of\n Python came our or an old version reached end-of-life\n* Minimising (ideally to zero) how much you need to customise an otherwise generic CI\n config when you re-use it for different types of Python packages (e.g. pure vs impure)\n\n## Installation\n\nThis package is available on PyPI, install it to your current Python environemnt with\n```bash \npip install ci-helper\n```\n\n## Usage:\n\n```bash\n# All stable, non-end-of-life Python versions:\n$ ci-helper pythons\n3.9,3.10,3.11,3.12,3.13\n\n# Same but in the format used by `cibuildwheel`'s `CIBW_BUILD` environment variable (cpython-only for now):\n$ ci-helper pythons --cibw\ncp39-* cp310-* cp311-* cp312-* cp313-*\n\n# The second-most recent minor Python release, a good choice for the version to run\n# tools from:\n$ ci-helper defaultpython\n3.12\n\n# Info about the source Python project in the current working directory - name, version,\n# whether it's a pure Python package, and whether its build or run requirements contain\n# any # environment markers (that is, whether its requirements vary by platform or\n# Python version):\n$ ci-helper distinfo .\n{\n \"name\": \"ci-helper\",\n \"version\": \"0.1.dev1+g5043fb5.d20241202\",\n \"is_pure\": true,\n \"has_env_markers\": false\n}\n\n# Same but one field at a time, more convenient for assigning to environment variables:\n$ ci-helper distinfo name .\nci-helper\n$ ci-helper distinfo version .\n0.1.0\n$ ci-helper distinfo is_pure .\ntrue\n$ ci-helper distinfo has_env_markers .\nfalse \n```\n\n## Full help text\n\n```shell\n$ ci-helper -h\nusage: ci-helper [-h] [--version] {pythons,defaultpython,distinfo} ...\n\npositional arguments:\n {pythons,defaultpython,distinfo}\n Action to perform\n pythons Output list of stable Python versions that have not yet reached end of life, see `ci-helper pythons -h`\n defaultpython Output the second-latest stable Python version in X.Y format, useful as a good choice for a default python version\n distinfo Output info about the distribution, see `ci-helper distinfo -h`\n\noptions:\n -h, --help show this help message and exit\n --version show program's version number and exit\n```\n\n```shell\n$ ci-helper pythons -h\nusage: ci-helper pythons [-h] [--cibw]\n\noptions:\n -h, --help show this help message and exit\n --cibw Output as a space-separated list in the format `cpXY-* cpXY-*` as appropriate for the CIBW_BUILD environment variable to build for all\n stable CPython versions, otherwise versions are output as a comma-separated list in the format X.Y,X.Y\n```\n\n```shell\n$ ci-helper default_python -h\nusage: ci-helper defaultpython [-h]\n\noptions:\n -h, --help show this help message and exit\n```\n\n```shell\n$ ci-helper distinfo -h\nusage: ci-helper distinfo [-h]\n [{name,version,is_pure,has_env_markers}]\n project_directory\n\npositional arguments:\n {name,version,is_pure,has_env_markers}\n Name of field to output as a single json value, if not\n given, all info is output as json\n project_directory Directory of Python project\n\noptions:\n -h, --help show this help message and exit\n```\n\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Christopher Billington Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Get info on how a package should be built on CI",
"version": "0.3.0",
"project_urls": {
"Documentation": "https://github.com/chrisjbillington/ci-helper",
"Downloads": "https://pypi.org/project/ci-helper/",
"Homepage": "https://github.com/chrisjbillington/ci-helper",
"Repository": "https://github.com/chrisjbillington/ci-helper",
"Tracker": "https://github.com/chrisjbillington/ci-helper/issues"
},
"split_keywords": [
"build",
" setuptools",
" ci"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d27203b4f8c6f7ed5a1d890592f3aac11e222842f26ef5a0142d45d804a0dda5",
"md5": "80574c1e63fd6c32c014fff0e5dc1325",
"sha256": "d2348f139927338e9618bfcbe7fbce56747fb1af090d06bf7194c9fef9dc1af8"
},
"downloads": -1,
"filename": "ci_helper-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "80574c1e63fd6c32c014fff0e5dc1325",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 8599,
"upload_time": "2024-12-03T23:02:34",
"upload_time_iso_8601": "2024-12-03T23:02:34.364674Z",
"url": "https://files.pythonhosted.org/packages/d2/72/03b4f8c6f7ed5a1d890592f3aac11e222842f26ef5a0142d45d804a0dda5/ci_helper-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4ab95019a3134d72fc7a7cfa73eb04b1e48b35a8c8aa4bdb49ea836a943bbb51",
"md5": "2bbabdc193af9e00b3919c1434640fb3",
"sha256": "262376298fd91dcc191aa5e02bedc0533808e38b3886d2fc08780aa5288e0097"
},
"downloads": -1,
"filename": "ci_helper-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "2bbabdc193af9e00b3919c1434640fb3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 7984,
"upload_time": "2024-12-03T23:02:35",
"upload_time_iso_8601": "2024-12-03T23:02:35.889934Z",
"url": "https://files.pythonhosted.org/packages/4a/b9/5019a3134d72fc7a7cfa73eb04b1e48b35a8c8aa4bdb49ea836a943bbb51/ci_helper-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 23:02:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "chrisjbillington",
"github_project": "ci-helper",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ci-helper"
}