pyproject-transition #922
@ -33,8 +33,7 @@ git push github $version
|
||||
|
||||
# Build borgmatic and publish to pypi.
|
||||
rm -fr dist
|
||||
python3 setup.py bdist_wheel
|
||||
python3 setup.py sdist
|
||||
witten marked this conversation as resolved
Outdated
|
||||
python3 -m build
|
||||
witten marked this conversation as resolved
witten
commented
When I try this inside a Python 3 virtualenv, the command doesn't appear to work:
Looks like it might need to be added to When I try this inside a Python 3 virtualenv, the command doesn't appear to work:
```
$ python3 -m build
/home/witten/Downloads/borgmatic/.tox/py312/bin/python3: No module named build
```
Looks like [it might need to be added]( https://build.pypa.io/en/stable/installation.html) to `test_requirements.txt`? And/or to `[build-system]` in `pyproject.toml`?
kaliko
commented
I believe there are two different issues here. One regarding tox and another one concerning the release script. My understanding of recent python packaging is that I believe we don't' need to tell tox to use it, and apparently tox can build the package without it, probably using plain Then there is no need to add But I fixed But this is something I let you decide, I don't know how you release borgmatic. I believe there are two different issues here. One regarding **tox** and another one concerning the **release script**.
My understanding of recent python packaging is that ``build`` module is only a build frontend supporting ``pyproject.toml`` to call the ``build-system`` (cf. [doc here](https://packaging.python.org/en/latest/tutorials/packaging-projects/#choosing-a-build-backend)).
I believe we don't' need to tell tox to use it, and apparently tox can build the package without it, probably using plain ``pip`` (an alternative build frontend ).
Then there is no need to add ``build`` module to ``test_requirements.txt`` IMHO.
But I fixed ``scripts/release`` to use it instead ``setup.py``.
Then I guess we should add ``build`` dependency somewhere in the release process.
Could be ``test_requirements.txt`` if you run the script within a tox venv, but I believe it's better to release from a pristine environment to avoid side effects of pre-populated venv with tons of deps for test/coverage/lint/etc….
But this is something I let you decide, I don't know how you release borgmatic.
witten
commented
Thanks for the explanation. I typically release borgmatic manually by running Thanks for the explanation. I typically release borgmatic manually by running `scripts/release` on my machine (not from a virtualenv), although I'm open to changing the process if it would help. But if the release script is the only place that requires a `build` dependency, I'm fine just manually installing it on my machine for now. And then if/when the release script moves to, say, CI, that automated process can install `build` accordingly.
|
||||
twine upload -r pypi --username __token__ dist/borgmatic-*.tar.gz
|
||||
twine upload -r pypi --username __token__ dist/borgmatic-*-py3-none-any.whl
|
||||
|
||||
|
Something is missing from the result tarball. Here's what I'm seeing on my machine:
Notice how most of the source subdirectories are missing:
borgmatic/actions/
,borgmatic/borg/
, etc.Package discovery was broken indeed and somehow my test failed to raise the issue (some leftovers interfered I guess). Anyway I fixed this in
601e393ec7
.I'm hoping to have more time next week to work on your comments,
Thanks for the review.
Cool, yeah, the tarball contents look much better now!