Skip to content

Commit

Permalink
Remove deprecated functions and modules (#737)
Browse files Browse the repository at this point in the history
* πŸ”₯ [core] Inline deprecated function `export_requirements`

* πŸ”₯ [core] Inline deprecated function `build_package`

* πŸ”₯ [core] Remove deprecated function `patch`

* πŸ”¨ [core] Inline variable `Session_install`

* πŸ”₯ [core] Inline deprecated function `install`

* πŸ”¨ [core] Inline function `installroot` in functional tests

* πŸ”¨ Replace nox.session with nox_poetry.session in functional tests

* πŸ”¨ [core] Inline function `installroot` in unit tests

* πŸ”₯ [core] Remove deprecated function `installroot`

* πŸ”₯ [core] Remove deprecated module `core`
  • Loading branch information
cjolowicz committed May 17, 2022
1 parent f9b6431 commit c9b89d1
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 324 deletions.
8 changes: 0 additions & 8 deletions src/nox_poetry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
- :const:`WHEEL`
- :const:`SDIST`
"""
from nox_poetry.core import build_package
from nox_poetry.core import export_requirements
from nox_poetry.core import install
from nox_poetry.core import installroot
from nox_poetry.poetry import DistributionFormat
from nox_poetry.sessions import Session
from nox_poetry.sessions import session
Expand All @@ -42,10 +38,6 @@
SDIST: str = DistributionFormat.SDIST

__all__ = [
"build_package",
"export_requirements",
"install",
"installroot",
"Session",
"session",
"SDIST",
Expand Down
101 changes: 0 additions & 101 deletions src/nox_poetry/core.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/nox_poetry/patch.py

This file was deleted.

8 changes: 2 additions & 6 deletions src/nox_poetry/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ def install(self, *args: str, **kwargs: Any) -> None:
kwargs: Keyword-arguments for ``session.install``. These are the same
as those for :meth:`nox.sessions.Session.run`.
"""
from nox_poetry.core import Session_install

args_extras = [_split_extras(arg) for arg in args]

if "." in [arg for arg, _ in args_extras]:
Expand Down Expand Up @@ -150,7 +148,7 @@ def rewrite(arg: str, extras: Optional[str]) -> str:
except CommandSkippedError:
return

Session_install(self.session, f"--constraint={requirements}", *args, **kwargs)
self.session.install(f"--constraint={requirements}", *args, **kwargs)

def installroot(
self,
Expand All @@ -173,8 +171,6 @@ def installroot(
distribution_format: The distribution format, either wheel or sdist.
extras: Extras to install for the package.
"""
from nox_poetry.core import Session_install

try:
package = self.build_package(distribution_format=distribution_format)
requirements = self.export_requirements()
Expand All @@ -198,7 +194,7 @@ def installroot(
"pip", "cache", "remove", name, success_codes=[0, 1], silent=True
)

Session_install(self.session, f"--constraint={requirements}", package)
self.session.install(f"--constraint={requirements}", package)

def export_requirements(self) -> Path:
"""Export a requirements file from Poetry.
Expand Down
79 changes: 0 additions & 79 deletions tests/functional/test_install.py

This file was deleted.

38 changes: 18 additions & 20 deletions tests/functional/test_installroot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""Functional tests for ``installroot``."""
import nox.sessions

import nox_poetry
from tests.functional.conftest import Project
from tests.functional.conftest import list_packages
Expand All @@ -10,12 +8,12 @@
def test_wheel(project: Project) -> None:
"""It builds and installs a wheel from the local package."""

@nox.session
def test(session: nox.sessions.Session) -> None:
@nox_poetry.session
def test(session: nox_poetry.Session) -> None:
"""Install the local package."""
nox_poetry.installroot(session, distribution_format=nox_poetry.WHEEL)
session.poetry.installroot(distribution_format=nox_poetry.WHEEL)

run_nox_with_noxfile(project, [test], [nox, nox.sessions, nox_poetry])
run_nox_with_noxfile(project, [test], [nox_poetry])

expected = [project.package, *project.dependencies]
packages = list_packages(project, test)
Expand All @@ -26,14 +24,14 @@ def test(session: nox.sessions.Session) -> None:
def test_wheel_with_extras(project: Project) -> None:
"""It installs the extra."""

@nox.session
def test(session: nox.sessions.Session) -> None:
@nox_poetry.session
def test(session: nox_poetry.Session) -> None:
"""Install the local package."""
nox_poetry.installroot(
session, distribution_format=nox_poetry.WHEEL, extras=["pygments"]
session.poetry.installroot(
distribution_format=nox_poetry.WHEEL, extras=["pygments"]
)

run_nox_with_noxfile(project, [test], [nox, nox.sessions, nox_poetry])
run_nox_with_noxfile(project, [test], [nox_poetry])

expected = [
project.package,
Expand All @@ -48,12 +46,12 @@ def test(session: nox.sessions.Session) -> None:
def test_sdist(project: Project) -> None:
"""It builds and installs an sdist from the local package."""

@nox.session
def test(session: nox.sessions.Session) -> None:
@nox_poetry.session
def test(session: nox_poetry.Session) -> None:
"""Install the local package."""
nox_poetry.installroot(session, distribution_format=nox_poetry.SDIST)
session.poetry.installroot(distribution_format=nox_poetry.SDIST)

run_nox_with_noxfile(project, [test], [nox, nox.sessions, nox_poetry])
run_nox_with_noxfile(project, [test], [nox_poetry])

expected = [project.package, *project.dependencies]
packages = list_packages(project, test)
Expand All @@ -64,14 +62,14 @@ def test(session: nox.sessions.Session) -> None:
def test_sdist_with_extras(project: Project) -> None:
"""It installs the extra."""

@nox.session
def test(session: nox.sessions.Session) -> None:
@nox_poetry.session
def test(session: nox_poetry.Session) -> None:
"""Install the local package."""
nox_poetry.installroot(
session, distribution_format=nox_poetry.SDIST, extras=["pygments"]
session.poetry.installroot(
distribution_format=nox_poetry.SDIST, extras=["pygments"]
)

run_nox_with_noxfile(project, [test], [nox, nox.sessions, nox_poetry])
run_nox_with_noxfile(project, [test], [nox_poetry])

expected = [
project.package,
Expand Down
Loading

0 comments on commit c9b89d1

Please sign in to comment.