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.

Nox session install not working

See original GitHub issue

I have been following along, and I realise the articles are a few years old and poetry, pip etc. have moved along.

But when the install_with_constraints function does the install it seems as though pip doesn’t like the constaints file. Just wondering if this is something anyone else has seen and/or knows a way around?

$ nox -s black
nox > Running session black
nox > Creating virtual environment (virtualenv) using python3.10 in .nox/black
nox > poetry export --with dev --format=requirements.txt --output=/tmp/tmplk132qu3
nox > python -m pip install --constraint=/tmp/tmplk132qu3 black
nox > Command python -m pip install --constraint=/tmp/tmplk132qu3 black failed with exit code 1:
DEPRECATION: Constraints are only allowed to take the form of a package name and a version specifier. Other forms were originally permitted as an accident of the implementation, but were undocumented. The new implementation of the resolver no longer supports these forms. A possible replacement is replacing the constraint with a requirement. Discussion can be found at https://github.com/pypa/pip/issues/8210
ERROR: Constraints cannot have extras
nox > Session black failed.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:7

github_iconTop GitHub Comments

2reactions
adamblakecommented, Oct 14, 2022

@accasey It’s actually two things:

  1. change the format to constraints.txt rather than requirements.txt to take care of the error you had (doesn’t output the extras)
  2. add --without-hashes to take care of an error that came up when I changed the format to constraints
1reaction
accaseycommented, Oct 14, 2022

Yes I see that now. Thanks again 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration & API — Nox 2022.11.21 documentation
Use of session.install() is deprecated without a virtualenv since it modifies the global Python environment. If this is what you really want, use...
Read more >
nox session doesn't find pytest installed by poetry #101 - GitHub
I just checked and the tests run without problem on the CI server. Running locally on my machine however gives the above error....
Read more >
How to use the nox.session function in nox - Snyk
How to use the nox.session function in nox. To help you get started, we've selected a few nox examples, based on popular ways...
Read more >
Get name of current nox session - Stack Overflow
This information is available at Session._runner.friendly_name : import nox @nox.session(python=['3.6', '3.7', '3.8', ...
Read more >
nox-poetry documentation
session. ; run("pytest") ; Installation#. Install nox-poetry from the Python Package Index: $ pip install nox-poetry. Important: This package must be installed ......
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