pyproject-transition #922

Merged
witten merged 7 commits from kaliko/borgmatic:pyproject-transition into main 2024-10-26 23:38:35 +00:00
Showing only changes of commit b029d1cb67 - Show all commits

View File

@ -56,3 +56,6 @@ profile = "black"
known_first_party = "borgmatic"
line_length = 100
skip = ".tox"
[tool.codespell]
skip = ".git,.tox,build"
witten marked this conversation as resolved
Review

This pyproject.toml looks good to me. But it seems to result in an unimportable borgmatic module, I'm guessing because setup.py is gone and something is still relying on it to consider borgmatic a module.

For instance, when I run tests, a particular test that tries to run the borgmatic executable fails:

$ tox
...
E               subprocess.CalledProcessError: Command '('borgmatic', '--version')' returned non-zero exit status 1.

/usr/lib/python3.12/subprocess.py:571: CalledProcessError
-------------------------------------------------------------- Captured stderr call --------------------------------------------------------------
Traceback (most recent call last):
  File "/home/witten/Downloads/borgmatic/.tox/py312/bin/borgmatic", line 5, in <module>
    from borgmatic.commands.borgmatic import main
ModuleNotFoundError: No module named 'borgmatic.commands'
...

And I can reproduce this by manually running borgmatic in the virtualenv:

$ . .tox/py312/bin/activate
$ borgmatic --version
Traceback (most recent call last):
  File "/home/witten/Downloads/borgmatic/.tox/py312/bin/borgmatic", line 5, in <module>
    from borgmatic.commands.borgmatic import main
ModuleNotFoundError: No module named 'borgmatic.commands'

So I'm not sure what's missing here.

This `pyproject.toml` looks good to me. But it seems to result in an unimportable `borgmatic` module, I'm guessing because `setup.py` is gone and something is still relying on it to consider `borgmatic` a module. For instance, when I run tests, a particular test that tries to run the `borgmatic` executable fails: ```bash $ tox ... E subprocess.CalledProcessError: Command '('borgmatic', '--version')' returned non-zero exit status 1. /usr/lib/python3.12/subprocess.py:571: CalledProcessError -------------------------------------------------------------- Captured stderr call -------------------------------------------------------------- Traceback (most recent call last): File "/home/witten/Downloads/borgmatic/.tox/py312/bin/borgmatic", line 5, in <module> from borgmatic.commands.borgmatic import main ModuleNotFoundError: No module named 'borgmatic.commands' ... ``` And I can reproduce this by manually running borgmatic in the virtualenv: ```bash $ . .tox/py312/bin/activate $ borgmatic --version Traceback (most recent call last): File "/home/witten/Downloads/borgmatic/.tox/py312/bin/borgmatic", line 5, in <module> from borgmatic.commands.borgmatic import main ModuleNotFoundError: No module named 'borgmatic.commands' ``` So I'm not sure what's missing here.
Review

Fixed with 601e393ec7 (pyproject/build failed to ship submodules).

Fixed with 601e393ec7 (pyproject/build failed to ship submodules).