question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mLewisLogiccommented, Oct 7, 2020

K, session.install vs nox_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 in core.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 of nox_poetry.install. Perhaps if an SDIST 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!

0reactions
cjolowiczcommented, Dec 2, 2020

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.

Also, since you’re specifying install sources by sha256, you could probably skip the uninstall step (and maybe even the install step) if the shas match?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found