Comments (3)
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:
$ /bin/bash script.sh
Outputs tmpl-package-0.1.0.tar.gz
:
$ /bin/bash script.sh ~/Downloads/poetry_dynamic_versioning-0.12.2a1-py3-none-any.whl
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 build_requires.py
helper which is raising the error. I haven't looked at it in any depth though so might be way off the mark!
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 <[email protected]>"]
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 '' ''
from poetry-dynamic-versioning.
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.
from poetry-dynamic-versioning.
Excellent! I've just released the fix as v0.12.2 :D
from poetry-dynamic-versioning.
Related Issues (20)
- Isn't compatible with Poetry 1.6.x HOT 3
- Using poetry to install dependency with poetry-dynamic-versioning HOT 4
- Create a file with the version in it without any "replacement magic" HOT 3
- Keep the apostrophe/quotation marks in pyproject version replacement HOT 2
- Version not substituted for chained package dependencies HOT 2
- SETUPTOOLS_SCM_PRETEND_VERSION vs POETRY_DYNAMIC_VERSIONING_BYPASS HOT 2
- Got an error with 'poetry update' HOT 3
- Whl files generated by poetry build do not contain the static version files specific in substitiution HOT 4
- Check file existance for `[tool.poetry-dynamic-versioning.substitution]` HOT 3
- `poetry install` with editable deps using dynamic versions always reports a downgrade. HOT 1
- Getting PermissionError when using poetry-dynamic-versioning in GitHub CI HOT 3
- poetry publish can't find files built with with dynamic versioning HOT 1
- `AssertionError: would build wheel with unsupported tag ('cp312', 'cp311', 'macosx_11_0_arm64')` HOT 2
- Plugin breaks poetry 1.8.0 HOT 2
- Push to PyPI, even in dirty mode HOT 2
- __version__.py file not included in build HOT 3
- poetry-dynamic-versioning fails to retrieve version with poetry 1.8.1 and 1.8.2 HOT 2
- What would you need to stop monkeypatching `poetry.core`? HOT 2
- Plugin installation crashes HOT 2
- Feature request: optional tag prefix for monorepo support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poetry-dynamic-versioning.