Skip to content

Commit

Permalink
chore: prevent poetry 1.3 from removing setuptools
Browse files Browse the repository at this point in the history
`poetry install` removes untracked packages by default in 1.3, among
them setuptools.  This causes all subsequent Python invocations
(including the one poetry uses to get the system tags from a virtual
environment) to fail with e.g.

``` Error processing line 1 of /opt/homebrew/Caskroom/miniforge/base/envs/test/lib/python3.10/site-packages/distutils-precedence.pth:

  Traceback (most recent call last):
    File
    "/opt/homebrew/Caskroom/miniforge/base/envs/test/lib/python3.10/site.py",
    line 186, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  ModuleNotFoundError: No module named '_distutils_hack'
```

As a workaround, make setuptools an explicit dev dependency so
`poetry install` works by default.  This is similar, but possibly
not identical, to python-poetry/poetry#4242
  • Loading branch information
jvansanten committed Jan 5, 2023
1 parent c61ce49 commit d5c9e37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ pytest-cov = "^2.12.1"
pytest-mock = "^3.6.1"
types-requests = "^2.25.9"
types-pytz = "^2021.1.2"
# prevent poetry 1.3 from removing setuptools
setuptools = "*"

[tool.poetry.extras]
sncosmo = ["sncosmo", "iminuit", "sfdmap"]
Expand Down

0 comments on commit d5c9e37

Please sign in to comment.