Issue specifying `DistributionFormat` to install
See original GitHub issue👋 Just started playing with the lib. Love the concept.
I tried running the following:
import nox
import nox_poetry.patch # noqa
from nox.sessions import Session
from nox_poetry.poetry import DistributionFormat
@nox.session(python=["3.8"])
def test(session: Session) -> None:
session.install(".", DistributionFormat.SDIST)
session.run("pytest")
Oddly enough it executed both poetry build --format=wheel
and poetry build --format=sdist
.
It then tried to run its uninstall stage for both distribution types and blew up on the sdist step.
nox > pip uninstall --yes file:///Users/mike/code/bookie/submodules/nautilus_trader/dist/nautilus_trader-1.75.0-cp38-cp38-macosx_10_15_x86_64.whl#sha256=fa0c39cd79a49f01b31692aeacb1b87900cd754de0019f9f2b50bb826dd041ed
nox > pip uninstall --yes file:///Users/mike/code/bookie/submodules/nautilus_trader/dist/nautilus_trader-1.75.0.tar.gz#sha256=c5d6037013386b75cd459ab417e3dd6cb4f0846d155839055663a376b7c90de1
nox > Command pip uninstall --yes file:///Users/mike/code/bookie/submodules/nautilus_trader/dist/nautilus_trader-1.75.0.tar.gz#sha256=c5d6037013386b75cd459ab417e3dd6cb4f0846d155839055663a376b7c90de1 failed with exit code 1:
Is this a bug, or am I using the tool incorrectly?
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Change source distribution format from tar.gz to zip #2830
Our current source distribution format is tar.gz but we should change it to zip for these reasons: On Windows you can open zip...
Read more >DP installation, upgrade, and configuration - Microsoft Learn
Describes Distribution points installation, upgrade, configuration changes, removal, and how these operations work.
Read more >4. Creating a Source Distribution — Python 3.11.1 ...
4.1. Specifying the files to distribute¶ · MANIFEST.in by default. The manifest template is just a list of instructions for how to generate...
Read more >Install a Custom Linux Distribution on a Compute Instance
Install the Distribution · In the Cloud Manager, reboot your Compute Instance using the Installer configuration profile. · Open Glish and, once ...
Read more >Chapter 4. Installing Applications: Packages and Ports
If the software was distributed in source format, compile it. This may involve editing a Makefile or running a configure script. Test and ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
K,
session.install
vsnox_poetry.install
was the issue that was causing both wheels and sdist to build.I think I figured out the issue with the sdist uninstall.
Pretty sure that there needs to be an
&egg=package-name
appended to the return path incore.build_package
.Pip callchain:
So, seems like we’d want the user to pass in an egg name (though I guess we could try to extract it from the
.tar.gz
file, but that seems excessive). Might change the calling semantics ofnox_poetry.install
. Perhaps if anSDIST
DistributionFormat
is passed then there must be exactly one arg (the name of the egg)? Maybe it’s different enough to warrant it’s own.install_sdist("package-name")
method? On the other hand, since it is a self build, maybe all of that is skipped and you just hack it with a static placeholder like&egg=nox-poetry-local-build
.Lots of ugly viable solutions!
This took a while longer, unfortunately… You analysis was spot on. No need to have the user pass the egg name, it’s just the name of the local package, which we can get from Poetry. Do let me know if sdists are still a problem, and thanks again for the report and analysis.
I don’t think that would work. We’d need the sha256 of the package that was previously installed, and we don’t have that anymore.