-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
Errors building with poetry-core through tox #37
Comments
Thanks for this report! I think I've identified a fix for both errors (although I don't quite understand how the first one managed to happen). Would you mind trying this wheel? poetry_dynamic_versioning-0.12.2a1-py3-none-any.zip It has the changes from the commit that I just pushed. |
Hi, thanks for looking at this so quickly! I can confirm the fix works. I couldn't work out how to tell tox to install a build dependency from a local version so I made a bash script that creates a minimal package/poetry/tox/git setup and makes the same set of calls that tox makes to generate the errors. If you pass in the location of the wheel as a positional argument it will install p-d-v from that and all runs fine. E.g., Fails with above errors: Outputs It feels to me like the first error looks like an import side-effect, as seems to happen before anything has executed in the tox Here's the script: #!/bin/bash
# get loc. of pdv from arg, or use pypi.
PDV=${1:-"poetry_dynamic_versioning"}
# Create a temporary directory and store its name in a variable ...
TMPDIR=$(mktemp -d)
# Bail out if the temp directory wasn't created successfully.
if [ ! -e $TMPDIR ]; then
>&2 echo "Failed to create temp directory"
exit 1
fi
# Make sure it gets removed even if the script exits abnormally.
trap "exit 1" HUP INT PIPE QUIT TERM
trap 'rm -rf "$TMPDIR"' EXIT
echo "Created $TMPDIR"
cd $TMPDIR
mkdir -p src/tmpl-package
touch src/tmpl-package/__init__.py
# make pyproject.toml
cat >./pyproject.toml <<EOL
[tool.poetry]
name = "tmpl-package"
version = "0.0.0"
description = "something"
authors = ["me <me@mail.com>"]
packages =[{include = "tmpl-package", from = "src"}]
[tool.poetry-dynamic-versioning]
enable = true
[build-system]
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning"]
build-backend = "poetry.core.masonry.api"
EOL
# make tox.ini
cat >./tox.ini <<EOL
[tox]
envlist=py39
isolated_build=true
EOL
git init && git add . && git commit -m "testing" && git tag v0.1.0
python -m venv .venv
source .venv/bin/activate
PYTHON=$(which python)
SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])')
echo $PYTHON
echo $SITE_PACKAGES
python -m pip install tox
$PYTHON -m virtualenv --no-download --python $PYTHON .package
.package/bin/python -m pip install 'poetry-core>=1.0.0' $PDV
.package/bin/python /home/peter/.pyenv/versions/3.9.1/lib/python3.9/site-packages/tox/helper/build_requires.py poetry.core.masonry.api '' ''
.package/bin/python /home/peter/.pyenv/versions/3.9.1/lib/python3.9/site-packages/tox/helper/build_isolated.py .tox/dist poetry.core.masonry.api '' '' |
Excellent! I've just released the fix as v0.12.2 :D |
Hi,
Thanks for the tool, I'm looking forward to adopting it!
This looks similar to #35 in that I'm experiencing issues when tox tries to build my project using poetry-core.
Build system config:
Here is the tox log showing the installed libs:
And there are 2 log files with errors after tox fails to package the project:
... and this:
If I remove
"poetry-dynamic-versioning"
from the build-system requirements tox is able to build the project and run tests etc.I'm happy to provide more info if necessary, and apologies if I'm doing something stupid/missed something obvious!
The text was updated successfully, but these errors were encountered: