-
Notifications
You must be signed in to change notification settings - Fork 18
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
Install all dependencies without installing wheel #680
Comments
Hi @johnthagen you could use session.run_always("poetry", "install", "--no-root", "--no-dev", external=True)
session.install("mypy") When reusing virtualenvs, the Alternatively, you could export the non-dev dependencies to a requirements file using I'll also say that it's good practice to run all checks against the installed package. This prevents spurious outcomes due to dirty source trees or broken packaging. But you do say that your application is not intended to be installed as a package, so I understand your use case is slightly different. |
@cjolowicz Thanks for the reply (and the great package you've created).
Yeah, I do feel like this is probably a decent market share, for example Pipenv targets only applications and it still ended up being very popular. I see streamlining that use case as being valuable as well.
Ah, that's too bad, I wonder if in practice (running type checking multiple times during development) if the delay of that would end up being overall worse. When I get some time I will try both methods and compare.
Yeah, I totally agree for packages/libraries this is the case. |
Actually, you can benefit from nox -R here. This is a newer option that will skip |
Hmm, I tried out: session.run_always("poetry", "install", "--no-root", "--no-dev", external=True)
... But the problem I hit is this modifies the environment that
import nox
from nox_poetry import Session, session
nox.options.reuse_existing_virtualenvs = True
@session
def licenses(s: Session) -> None:
s.run_always("poetry", "install", "--no-root", "--no-dev", external=True)
s.run("pip-licenses", *s.posargs) Should |
Okay, the best workaround I could get working for this is: @session
def licenses(s: Session) -> None:
with NamedTemporaryFile() as requirements_file:
s.run_always(
"poetry",
"export",
"--without-hashes",
"-o",
requirements_file.name,
external=True,
)
s.install("pip-licenses", "-r", requirements_file.name)
s.run("pip-licenses", *s.posargs) It would be great if Edit: This exact snippet will not work on Windows as Poetry can't write to the open temporary file: https://stackoverflow.com/a/23212515 |
Is it possible to install all of the root dependencies though
nox-poetry
but not try to build/install the wheel? I have sessions where I need to install all dependencies but don't want to install the package itself (this is an application, so the wheel is not actually used).My session looks like:
And when I run
nox -s type_check
, I seenox
building, uninstalling, and installing a wheel for the local code that is not needed.In
tox
, the equivalent would beskipsdist
global option or theskip_install
session option.The text was updated successfully, but these errors were encountered: