Skip to content

Packaging update #519

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

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ neovim/ui/screen.c
neovim/ui/screen.so
build/
dist/
venv
*.pyc
.cache
.eggs
.tox
.pytest_cache

# Sphinx documentation
docs/_build/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Release
- bump the version in `pynvim/util.py` and `setup.py` (3 places in total)
2. Make a release on GitHub with the same commit/version tag and copy the message.
3. Run `scripts/disable_log_statements.sh`
4. Run `python setup.py sdist`
4. Run `python -m build`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be only for a particular PEP517 choice python-build. Shouldn't we have pip install build somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't thought of adding that, but will if you believe it's necessary. I don't think it's really necessary for two reasons:

  1. This is only for building the package for distribution - not for general end-user installation or re-installation. The build package is not actually required for installing our package.
  2. We're using the twine library a few lines below and don't mention pip install twine for that either.

I chose this method because it brings us into compliance with pep 517 with minimal effort and almost no change to the package as a whole.

At some point, someone will probably want to do some more work to move a lot of the code from the setup.py file to the pyproject.toml file, but this at least makes us compliant and will stop pip from complaining every time someone installs the package (as it is doing now).

- diff the release tarball `dist/pynvim-x.y.z.tar.gz` against the previous one.
5. Run `twine upload -r pypi dist/pynvim-x.y.z.tar.gz`
5. Run `twine upload -r pypi dist/*`
- Assumes you have a pypi account with permissions.
6. Run `scripts/enable_log_statements.sh` or `git reset --hard` to restore the working dir.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@
setup_requires=setup_requires,
tests_require=tests_require,
extras_require=extras_require,
zip_safe=False)
options={"bdist_wheel": {"universal": True}},
)