Name | check-pyproject JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | This tool facilitates syncing of the project and the tool.poetry tables in your pyproject.toml. |
upload_time | 2024-08-26 21:50:14 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.11 |
license | MIT License Copyright (c) <year> <copyright holders> 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 |
check
pyproject
python
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<!--
SPDX-FileCopyrightText: 2024 Roy Wright
SPDX-License-Identifier: MIT
-->
# Check PyProject
[![PyPI - Version](https://img.shields.io/pypi/v/check_pyproject.svg)](https://pypi.org/project/check_pyproject)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/check_pyproject.svg)](https://pypi.org/project/check_pyproject)
---
## Table of Contents
<!-- TOC -->
- [Check PyProject](#check-pyproject)
- [Table of Contents](#table-of-contents)
- [Overview](#overview)
- [Installation](#installation)
- [PyPI Installation](#pypi-installation)
- [Development installation](#development-installation)
- [Development Prerequisites](#development-prerequisites)
- [Workflows](#workflows)
- [Tasks](#tasks)
- [Switching between development managers](#switching-between-development-managers)
- [Adding a dependency using poetry](#adding-a-dependency-using-poetry)
- [Adding a dependency using hatch](#adding-a-dependency-using-hatch)
- [License](#license)
- [References](#references) _ [Build tools](#build-tools) _
[FawltyDeps](#fawltydeps) \* [Documentation tools](#documentation-tools)
<!-- TOC -->
## Overview
Checks that [project] and [tool.poetry] tables are mostly in-sync in the
`pyproject.toml` file.
The Python Packaging User Guide now specifies `pyproject.toml` metadata.
Poetry <2.0 predates the metadata specification and instead used the then
current standard of [tool.poetry] table. While there is a lot of overlap, there
are some differences (ex. dependency package specifiers). Poetry 2.0 will
support PyPA pyproject.toml specification (formerly PEP 621) which will obsolete
this utility.
So if your project uses poetry and any other tool that requires the current
pyproject.toml metadata, or you are prepping for Poetry 2.0 and do not want to
use the development version of Poetry. then you need to manually maintain sync
between [project] and [tool.poetry] tables.
This tool checks that overlapping metadata, between [project] and [tool.poetry]
tables, are roughly in-sync.
## Installation
### PyPI Installation
`pip install check_pyproject`
### Development installation
#### Development Prerequisites
- Install the task manager: [Task](https://taskfile.dev/)
- Optionally install [pyenv-installer](https://github.com/pyenv/pyenv-installer)
- Install dependent pythons, example:
`pyenv local 3.11.9 3.12.3`
_Note you may need to install some libraries for the pythons to compile
cleanly._ _For example on ubuntu (note I prefer `nala` over `apt`):_
`sudo nala install tk-dev libbz2-dev libreadline-dev libsqlite3-dev lzma-dev python3-tk libreadline-dev`
- Recommended to upgrade pip to latest.
- Optionally install [Poetry](https://python-poetry.org/)
- Optionally install [Hatch](https://hatch.pypa.io/)
- Install [pip-tools](https://pypi.org/project/pip-tools/)
- Optionally install [setuptools](https://setuptools.pypa.io/)
- Install [build](https://build.pypa.io/)
- Install [pip-tools](https://pypi.org/project/pip-tools/)
- Install [twine](https://twine.readthedocs.io/)
Install the package using your favorite dev tool. Examples:
- `git clone git@github.com:royw/check_pyproject.git`
- `cd check_pyproject`
- `task init`
- `task make`
_Note, `task init` will run `git init .`, `git add` the initial project files,
and do a `git commit`. If you are using another VCS, please first edit the init
task in the `Taskfile-*.yml` files._
## Workflows
### Tasks
The `Taskfile.yml` is used to build your workflow as a set of tasks. The initial
workflow is:
task clean # removes all build artifacts (metrics, docs,...)
task make # lints, formats, checks pyproject.toml, and generates metrics, performs unit tests,
performs multi-python version testing, and creates the package.
task docs # creates local documentation, starts a local server, opens the home page of the documents in a browser.
task main # launches the application in the poetry environment.
This is a starting off point so feel free to CRUD the tasks to fit your needs,
or not even use it.
### Switching between development managers
The tasks that support switching the build system:
task switch-to-poetry
task switch-to-hatch
task switch-to-setuptools
They set the symbolic link for `taskfiles/front-end.yaml` to the appropriate
`taskfiles/poetry.yaml`, `taskfiles/hatch.yaml`, or `taskfiles/setuptools.yaml`.
Note that `taskfiles/front-end.yaml` is imported by `Taskfile.yaml` as `fe`
which stands for "front end":
includes:
fe: taskfiles/front-end.yaml
Also, the switch tasks edit the `build-system` table in the `pyproject.toml`
file to the appropriate back-end.
### Adding a dependency using poetry
Add the dependency using the poetry CLI.
poetry add --group dev some_tool
task make
The build ought to fail as [project] and [tool.poetry] dependencies are now out
of sync. But the output includes the PEP 508 dependency just added that you can
copy and paste into the [project] table's appropriate dependency.
task make
Should pass this time.
### Adding a dependency using hatch
Manually edit the `pyproject.toml` file and add the dependency to both [project]
and [tool.poetry] dependency tables. Then running
task make
Will show any version specifier mismatches...
## License
`check_pyproject` is distributed under the terms of the
[MIT](https://spdx.org/licenses/MIT.html) license.
## References
- The [Python Packaging User Guide](https://packaging.python.org/en/latest)
- The
[pyproject.toml specification](https://pypi.python.org/pypi/pyproject.toml)
- The [Poetry pyproject.toml metadata](https://python-poetry.org/docs/pyproject)
- [pip documentation](https://pip.pypa.io/en/stable/)
- [Setuptools](https://setuptools.pypa.io/)
### Build tools
- [loguru](https://loguru.readthedocs.io) improved logging.
- [pytest](https://docs.pytest.org) unit testing.
- [pathvalidate](https://pathvalidate.readthedocs.io)
- [tox](https://tox.wiki) multiple python testing.
- [radon](https://radon.readthedocs.io) code metrics.
- [Ruff](https://docs.astral.sh/ruff/) is an extremely fast Python linter and
code formatter, written in Rust.
- [FawltyDeps](https://github.com/tweag/FawltyDeps) is a dependency checker for
Python that finds undeclared and/or unused 3rd-party dependencies in your
Python project.
- [Reuse](https://reuse.readthedocs.io/) is a tool for compliance with the
[REUSE](https://reuse.software/) recommendations.
- [MyPy](https://www.mypy-lang.org/)
#### FawltyDeps
This tool does a great job in helping keep bloat out of your project. There is
one small issue with it, it does not distinguish project dependencies from
dev/test/doc/... dependencies. So you have to manually add any new tools to the
used list in your [pyproject.toml], like:
poetry run fawltydeps --detailed --ignore-unused radon pytest-cov pytest tox fawltydeps mkdocs
mkdocstrings-python mkdocs-literate-nav mkdocs-section-index ruff mkdocs-material
### Documentation tools
After years of suffering with the complexity of sphinx and RST (the PyPA
recommended documentation tool), this project uses MkDocs and MarkDown.
Whoooooop!
**_Here is a big THANK YOU to the MkDocs team, the plugin teams, and the theme
teams!_**
**_Fantastic!_**
Plugins do a nice job of
[automatic code reference](https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages),
and a fantastic theme from the mkdocs-material team!
Configuration is in the `mkdocs.yml` file and the `docs/` and `scripts/`
directories.
The `task docs` will build the documentation into a static site, `site/`, and
run a server at http://localhost:8000/ and open the page in your browser.
- [MkDocs](https://www.mkdocs.org/) Project documentation with Markdown.
- [mkdocs-gen-files](https://github.com/oprypin/mkdocs-gen-files) Plugin for
MkDocs to programmatically generate documentation pages during the build
- [mkdocs-literate-nav](https://github.com/oprypin/mkdocs-literate-nav) Plugin
for MkDocs to specify the navigation in Markdown instead of YAML
- [mkdocs-section-index](https://github.com/oprypin/mkdocs-section-index) Plugin
for MkDocs to allow clickable sections that lead to an index page
- [mkdocstrings](https://mkdocstrings.github.io/) Automatic documentation from
sources, for MkDocs.
- [catalog](https://github.com/mkdocs/catalog) Catalog of MkDocs plugins.
- [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) Material
theme.
Raw data
{
"_id": null,
"home_page": null,
"name": "check-pyproject",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Roy Wright <roy@wright.org>",
"keywords": "check, pyproject, python",
"author": null,
"author_email": "Roy Wright <roy@wright.org>",
"download_url": "https://files.pythonhosted.org/packages/b7/33/73ce3467fa3b7dcc775e630838af3108eb8c435fa99767b9daab88740759/check_pyproject-0.1.0.tar.gz",
"platform": null,
"description": "<!--\nSPDX-FileCopyrightText: 2024 Roy Wright\nSPDX-License-Identifier: MIT\n-->\n\n# Check PyProject\n\n[![PyPI - Version](https://img.shields.io/pypi/v/check_pyproject.svg)](https://pypi.org/project/check_pyproject)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/check_pyproject.svg)](https://pypi.org/project/check_pyproject)\n\n---\n\n## Table of Contents\n\n<!-- TOC -->\n\n- [Check PyProject](#check-pyproject)\n - [Table of Contents](#table-of-contents)\n - [Overview](#overview)\n - [Installation](#installation)\n - [PyPI Installation](#pypi-installation)\n - [Development installation](#development-installation)\n - [Development Prerequisites](#development-prerequisites)\n - [Workflows](#workflows)\n - [Tasks](#tasks)\n - [Switching between development managers](#switching-between-development-managers)\n - [Adding a dependency using poetry](#adding-a-dependency-using-poetry)\n - [Adding a dependency using hatch](#adding-a-dependency-using-hatch)\n - [License](#license)\n - [References](#references) _ [Build tools](#build-tools) _\n [FawltyDeps](#fawltydeps) \\* [Documentation tools](#documentation-tools)\n <!-- TOC -->\n\n## Overview\n\nChecks that [project] and [tool.poetry] tables are mostly in-sync in the\n`pyproject.toml` file.\n\nThe Python Packaging User Guide now specifies `pyproject.toml` metadata.\n\nPoetry <2.0 predates the metadata specification and instead used the then\ncurrent standard of [tool.poetry] table. While there is a lot of overlap, there\nare some differences (ex. dependency package specifiers). Poetry 2.0 will\nsupport PyPA pyproject.toml specification (formerly PEP 621) which will obsolete\nthis utility.\n\nSo if your project uses poetry and any other tool that requires the current\npyproject.toml metadata, or you are prepping for Poetry 2.0 and do not want to\nuse the development version of Poetry. then you need to manually maintain sync\nbetween [project] and [tool.poetry] tables.\n\nThis tool checks that overlapping metadata, between [project] and [tool.poetry]\ntables, are roughly in-sync.\n\n## Installation\n\n### PyPI Installation\n\n`pip install check_pyproject`\n\n### Development installation\n\n#### Development Prerequisites\n\n- Install the task manager: [Task](https://taskfile.dev/)\n- Optionally install [pyenv-installer](https://github.com/pyenv/pyenv-installer)\n\n - Install dependent pythons, example:\n\n `pyenv local 3.11.9 3.12.3`\n\n _Note you may need to install some libraries for the pythons to compile\n cleanly._ _For example on ubuntu (note I prefer `nala` over `apt`):_\n\n `sudo nala install tk-dev libbz2-dev libreadline-dev libsqlite3-dev lzma-dev python3-tk libreadline-dev`\n\n- Recommended to upgrade pip to latest.\n- Optionally install [Poetry](https://python-poetry.org/)\n- Optionally install [Hatch](https://hatch.pypa.io/)\n - Install [pip-tools](https://pypi.org/project/pip-tools/)\n- Optionally install [setuptools](https://setuptools.pypa.io/)\n - Install [build](https://build.pypa.io/)\n - Install [pip-tools](https://pypi.org/project/pip-tools/)\n - Install [twine](https://twine.readthedocs.io/)\n\nInstall the package using your favorite dev tool. Examples:\n\n- `git clone git@github.com:royw/check_pyproject.git`\n- `cd check_pyproject`\n- `task init`\n- `task make`\n\n_Note, `task init` will run `git init .`, `git add` the initial project files,\nand do a `git commit`. If you are using another VCS, please first edit the init\ntask in the `Taskfile-*.yml` files._\n\n## Workflows\n\n### Tasks\n\nThe `Taskfile.yml` is used to build your workflow as a set of tasks. The initial\nworkflow is:\n\n task clean # removes all build artifacts (metrics, docs,...)\n task make # lints, formats, checks pyproject.toml, and generates metrics, performs unit tests,\n performs multi-python version testing, and creates the package.\n task docs # creates local documentation, starts a local server, opens the home page of the documents in a browser.\n task main # launches the application in the poetry environment.\n\nThis is a starting off point so feel free to CRUD the tasks to fit your needs,\nor not even use it.\n\n### Switching between development managers\n\nThe tasks that support switching the build system:\n\n task switch-to-poetry\n task switch-to-hatch\n task switch-to-setuptools\n\nThey set the symbolic link for `taskfiles/front-end.yaml` to the appropriate\n`taskfiles/poetry.yaml`, `taskfiles/hatch.yaml`, or `taskfiles/setuptools.yaml`.\nNote that `taskfiles/front-end.yaml` is imported by `Taskfile.yaml` as `fe`\nwhich stands for \"front end\":\n\n includes:\n fe: taskfiles/front-end.yaml\n\nAlso, the switch tasks edit the `build-system` table in the `pyproject.toml`\nfile to the appropriate back-end.\n\n### Adding a dependency using poetry\n\nAdd the dependency using the poetry CLI.\n\n poetry add --group dev some_tool\n task make\n\nThe build ought to fail as [project] and [tool.poetry] dependencies are now out\nof sync. But the output includes the PEP 508 dependency just added that you can\ncopy and paste into the [project] table's appropriate dependency.\n\n task make\n\nShould pass this time.\n\n### Adding a dependency using hatch\n\nManually edit the `pyproject.toml` file and add the dependency to both [project]\nand [tool.poetry] dependency tables. Then running\n\n task make\n\nWill show any version specifier mismatches...\n\n## License\n\n`check_pyproject` is distributed under the terms of the\n[MIT](https://spdx.org/licenses/MIT.html) license.\n\n## References\n\n- The [Python Packaging User Guide](https://packaging.python.org/en/latest)\n- The\n [pyproject.toml specification](https://pypi.python.org/pypi/pyproject.toml)\n- The [Poetry pyproject.toml metadata](https://python-poetry.org/docs/pyproject)\n- [pip documentation](https://pip.pypa.io/en/stable/)\n- [Setuptools](https://setuptools.pypa.io/)\n\n### Build tools\n\n- [loguru](https://loguru.readthedocs.io) improved logging.\n- [pytest](https://docs.pytest.org) unit testing.\n- [pathvalidate](https://pathvalidate.readthedocs.io)\n- [tox](https://tox.wiki) multiple python testing.\n- [radon](https://radon.readthedocs.io) code metrics.\n- [Ruff](https://docs.astral.sh/ruff/) is an extremely fast Python linter and\n code formatter, written in Rust.\n- [FawltyDeps](https://github.com/tweag/FawltyDeps) is a dependency checker for\n Python that finds undeclared and/or unused 3rd-party dependencies in your\n Python project.\n- [Reuse](https://reuse.readthedocs.io/) is a tool for compliance with the\n [REUSE](https://reuse.software/) recommendations.\n- [MyPy](https://www.mypy-lang.org/)\n\n#### FawltyDeps\n\nThis tool does a great job in helping keep bloat out of your project. There is\none small issue with it, it does not distinguish project dependencies from\ndev/test/doc/... dependencies. So you have to manually add any new tools to the\nused list in your [pyproject.toml], like:\n\n poetry run fawltydeps --detailed --ignore-unused radon pytest-cov pytest tox fawltydeps mkdocs\n mkdocstrings-python mkdocs-literate-nav mkdocs-section-index ruff mkdocs-material\n\n### Documentation tools\n\nAfter years of suffering with the complexity of sphinx and RST (the PyPA\nrecommended documentation tool), this project uses MkDocs and MarkDown.\nWhoooooop!\n\n**_Here is a big THANK YOU to the MkDocs team, the plugin teams, and the theme\nteams!_**\n\n**_Fantastic!_**\n\nPlugins do a nice job of\n[automatic code reference](https://mkdocstrings.github.io/recipes/#automatic-code-reference-pages),\nand a fantastic theme from the mkdocs-material team!\n\nConfiguration is in the `mkdocs.yml` file and the `docs/` and `scripts/`\ndirectories.\n\nThe `task docs` will build the documentation into a static site, `site/`, and\nrun a server at http://localhost:8000/ and open the page in your browser.\n\n- [MkDocs](https://www.mkdocs.org/) Project documentation with Markdown.\n- [mkdocs-gen-files](https://github.com/oprypin/mkdocs-gen-files) Plugin for\n MkDocs to programmatically generate documentation pages during the build\n- [mkdocs-literate-nav](https://github.com/oprypin/mkdocs-literate-nav) Plugin\n for MkDocs to specify the navigation in Markdown instead of YAML\n- [mkdocs-section-index](https://github.com/oprypin/mkdocs-section-index) Plugin\n for MkDocs to allow clickable sections that lead to an index page\n- [mkdocstrings](https://mkdocstrings.github.io/) Automatic documentation from\n sources, for MkDocs.\n- [catalog](https://github.com/mkdocs/catalog) Catalog of MkDocs plugins.\n- [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) Material\n theme.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) <year> <copyright holders> 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": "This tool facilitates syncing of the project and the tool.poetry tables in your pyproject.toml.",
"version": "0.1.0",
"project_urls": {
"check_pyproject": "https://github.com/royw/check_pyproject"
},
"split_keywords": [
"check",
" pyproject",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5135d10275770537306cb45fa2d3581277f6e8c7b24ff5164e9478761a38b6df",
"md5": "441cf91ab2b9f26551a9b2947f499fcd",
"sha256": "0ebb34b9d603b55993421ba02c220a6d5d3d0f404fdbdc69d2117a70e81d2daf"
},
"downloads": -1,
"filename": "check_pyproject-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "441cf91ab2b9f26551a9b2947f499fcd",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 26965,
"upload_time": "2024-08-26T21:50:12",
"upload_time_iso_8601": "2024-08-26T21:50:12.043297Z",
"url": "https://files.pythonhosted.org/packages/51/35/d10275770537306cb45fa2d3581277f6e8c7b24ff5164e9478761a38b6df/check_pyproject-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b73373ce3467fa3b7dcc775e630838af3108eb8c435fa99767b9daab88740759",
"md5": "69f590562f6c9efa4646e1376911e681",
"sha256": "4198177435d0d97fc56faa8acd49690c16794c298fa02713f506eae885e5a5af"
},
"downloads": -1,
"filename": "check_pyproject-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "69f590562f6c9efa4646e1376911e681",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 134740,
"upload_time": "2024-08-26T21:50:14",
"upload_time_iso_8601": "2024-08-26T21:50:14.591951Z",
"url": "https://files.pythonhosted.org/packages/b7/33/73ce3467fa3b7dcc775e630838af3108eb8c435fa99767b9daab88740759/check_pyproject-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-26 21:50:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "royw",
"github_project": "check_pyproject",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "check-pyproject"
}