New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
replace the old building and packaging tools with poetry #1638
Conversation
the setup is configured in pyproject.toml file. setup.py file is not needed anymore. poetry will restore the metadata from pyproject.toml file
the dev requirements are defined under [tool.poetry.dev-dependencies] section in pyproject.toml file
Publish with poetry
restore the requirements in setup.py file
restore the whole setup.py file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a cookicutter maintainer, but I have some experience with Poetry, I've noted a couple of things you might find useful.
Publish with poetry
use older version of poetry-core
fix invalid argument poetry-core
fix invalid argument poetry-core
* run actions in self-hosted runner * run lint ci on ubuntu-latest runner * setup poetry-install ci job * add tox to dev-dependencies and restrict dev-dependencies versions * use actions/setup-python verion 2 and install dev dependencies through poetry * remove no-dev option * poetry install all dev dependencies * use actions/setup-python verion 1 * try actions/setup-python verion 2 * add poetry to build job * use poetry-core version 1.10 * remove setup.py file * remove test_requirements.txt file * add poetry to tox * remove the publish part from Makefile * use actions/setup-python verion 1 * add no-root option to poetry install * add poetry to PATH * try install poetry from snok actions * restore install poetry * install poetry * install poetry only once * install poetry * use python version 3.10 * use pip in tox * use pip in tox * run pip within poetry * run pre-commit within poetry * restore poetery install in tox file * whitelist poetry * remove __init__ file from tests directry * restore __init__ file to tests directry * install dependencies in tox * use python version 1 * use actions/setup-python verion 2 * run pytest in tox * remove pytest from tox * restore test_requirements file * remove test_requirements file * match matrix.os with windows * check runner matrix.os if windows * check runner matrix.os if windows * print console matrix.os * print console matrix.os * use matrix.name instead of matrix.os * remove mistuping * add part was removed by mistake * fix set PATH for windows os * print GITHUB_PATH and APPDATA to console * print GITHUB_PATH and APPDATA to console * print GITHUB_PATH and APPDATA to console * print env to console * print env to console for linux machines * print env to console * try appsolute path to poetry in windows * printout GITHUB_PATH file * printout GITHUB_PATH file * printout GITHUB_PATH file * default shell is bash * remove printout env * remove pytest-plugin * remove get full python version step * remove poetry install from tox * remove poetry run from tox * add poetry run to tox * use python verison 3.9 * use python version 3.10 and remove spaces * rename install poetry step * remove default shell * restore default shell * add step: get full python version * tey matrix.install-args * remove get full python version and setup cache * revert changes of today * try snok/install-poetry action * add setup-python action * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * try default shell sh * revert default shell to bash * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * continue with snok/install-poetry action * revert snok/install-poetry action * setup poetry action * setup poetry action * setup poetry action * setup poetry action * setup poetry action * refactor python to python-version * setup poetry action * remove empty lines * setup poetry action * setup poetry action * setup poetry action * add poetry to docs workflow * add poetry to pip-publish workflow * run publish workflow on push branch * finalyze the poetry work * update maintainers and dependencies pattern * install dependencies in tox file * add dev dependencies to pyproject file * run the pipeline on branch changes * try remove skip_install from tox * poetry install dependencies in tox testenv:lint and testenv:docs * use pre-commit version 2 * use pre-commit version 2 * use pre-commit version 2 with python version 3.6 * poetry install dependencies in the main testenv * non-isolated builds * non-isolated builds * use isolated builds * remove the pipeline running on branch changes * publish test release version 2.0.3
Publish with poetry
…etry Revert "Publish with poetry"
merge master to publish_with_poetry branch
Publish with poetry
Publish with poetry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about poetry benefits, but at least errors should be fixed.
Squash on merge. |
With 2.1.0 we follow now the official PyPA process for Github actions as defined here: https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ As Cookiecutter defines itself as a conservative project (https://cookiecutter.readthedocs.io/en/latest/CONTRIBUTING.html#implement-features) I tend to propose not merge this PR, since following the official way is IMO the conservative way. I personally doubt we have any advantages with Poetry here. But decision is up to the @cookiecutter/cookiecutter-sentinel core contributor team and the leads as a whole. What do we gain using Poetry? |
I also vote against poetry. Setuptools and PEP-517 are mature and a safe bet as of today. |
Even though I use Poetry for my personal projects, I do not see any additional benefits here. So I'm also 👎🏼 |
The work here started 7 months and was waiting for a merge since January. If I start now arguing how Poetry facilitates the packaging and whether it brings advantages to the project or not and how it solves problems, then I feel something is going wrong here with the timing. So as @jensens and @ericof are the new maintainers of Cookiecutter, here is a brief history of this PR: |
@HosamAlmoghraby let me try to summarize:
Meanwhile @ericof and I implemented the official PyPA release workflow (it was like 2h work). So there is no reason anymore left from what I get to merge this. It hurts, because work and time flew into this PR, but OTHO this how evolution of software works. I feel the pain with you. Question is - from the current state of 2.1.0: What are the benefits? What do we gain? I do not see much. One thing I like is there is no As said, I am conservative here. Unless I do not find a real problem solved, it is not worth to merge. Just for the sake of Poetry is not a reason. |
As long as the core team voted against the changes proposed here, I am fine with closing this PR. |
With the changes here I am adding poetry as dependencies and packaging management tool to cookiecutter. as setuptools and wheels are not needed anymore, they were removed from the ci workflows.
The publishing workflow is tested by building and pushing the package to the test repository of PyPI. here is the test release https://test.pypi.org/project/cookiecutter/2.0.2/
The CI Tests workflows are successful on all python versions.