Skip to content
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

Update dependencies and various fixes #1118

Merged
merged 10 commits into from
Jun 18, 2023
8 changes: 4 additions & 4 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pip==22.1.2
nox==2022.1.7
poetry==1.1.13
virtualenv==20.14.1
pip==23.1.2
nox==2023.4.22
poetry==1.5.1
virtualenv==20.23.1
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.10"
python-version: "3.11"

- name: Upgrade pip
run: |
Expand Down
7 changes: 2 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ def safety(session: Session) -> None:
def mypy(session: Session) -> None:
"""Type-check using mypy."""
args = session.posargs or ["src", "tests", "docs/conf.py"]
deps = [".", "mypy", "pytest"] + (
["types-dataclasses"] if session.python == "3.6" else []
)
session.install(*deps)
session.install(".", "mypy", "pytest")
session.run("mypy", *args)
if not session.posargs:
if not session.posargs and session.python == python_versions[0]:
session.run("mypy", f"--python-executable={sys.executable}", "noxfile.py")


Expand Down
2,899 changes: 1,656 additions & 1,243 deletions poetry.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ xdoctest = {extras = ["colors"], version = ">=0.15.10"}
sphinx = ">=4.3.2"
sphinx-autobuild = ">=2021.3.14"
pre-commit = ">=2.17.0"
flake8 = ">=4.0.1"
flake8 = {version = ">=4.0.1", python = ">= 3.8"}
black = ">=22.3"
flake8-bandit = ">=2.1.2"
flake8-bugbear = ">=22.1.11"
flake8-docstrings = ">=1.6.0"
flake8-rst-docstrings = ">=0.2.5"
pep8-naming = ">=0.12.1"
flake8-bandit = {version = ">=2.1.2", python = ">= 3.8"}
flake8-bugbear = {version = ">=22.1.11", python = ">= 3.8"}
flake8-docstrings = {version = ">=1.6.0", python = ">= 3.8"}
flake8-rst-docstrings = {version = ">=0.2.5", python = ">= 3.8"}
pep8-naming = {version = ">=0.12.1", python = ">= 3.8"}
darglint = ">=1.8.1"
pre-commit-hooks = ">=4.1.0"
furo = ">=2022.1.2"
Expand Down
1 change: 0 additions & 1 deletion src/nox_poetry/sessions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ from typing import overload
import nox.sessions
import nox.virtualenv


Python = Optional[Union[str, Sequence[str], bool]]

class _PoetrySession:
Expand Down
5 changes: 5 additions & 0 deletions tests/functional/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ def parse(line: str) -> Package:
# Abuse Package.version to store the URL or path.
name, _, version = line.partition(" @ ")

# Strip hashes returned by pip freeze.
pos = version.rfind("#sha256=")
if pos != -1:
version = version[:pos]

if name == project.package.name:
# But use the known version for the local package.
return project.package
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def tests(proxy: nox_poetry.Session, number: int) -> None:
tests(session, 1) # type: ignore[no-untyped-call]
tests(session, 2) # type: ignore[no-untyped-call]

proxies, numbers = zip(*calls)
proxies, numbers = zip(*calls) # noqa: B905

assert all(proxy._session is session for proxy in proxies)
assert numbers == (1, 2)
Expand Down Expand Up @@ -181,7 +181,7 @@ def test_to_constraints(requirements: str, expected: str) -> None:

def test_invalid_constraint() -> None:
"""It raises an exception."""
with pytest.raises(Exception):
with pytest.raises(RuntimeError):
to_constraints("example @ /tmp/example")


Expand Down