Skip to content

Commit

Permalink
Remove use of poetry
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins committed Sep 25, 2024
1 parent 80f452c commit 0ebbdc0
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 2,306 deletions.
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ jobs:
architecture: x64
- run: curl -fsSL https://d2lang.com/install.sh | sh -s --
- run: pip install nox==2022.8.7
- run: pip install poetry==1.2.2
- run: nox -p ${{ matrix.python-version }}
55 changes: 19 additions & 36 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@
nox.options.error_on_missing_interpreters = False

locations = "adijif", "tests", "noxfile.py"
main_python = "3.8"
multi_python_versions_support = ["3.8"]
main_python = "3.7"
multi_python_versions_support = ["3.7"]
package = "adijif"


def install_with_constraints(session, *args, **kwargs):
with tempfile.NamedTemporaryFile() as requirements:
session.run(
"poetry",
"export",
"--with",
"dev",
"--extras=cplex",
"--without-hashes",
"--format=requirements.txt",
f"--output={requirements.name}",
external=True,
)
session.install(f"--requirement={requirements.name}", *args, **kwargs)
session.install(*args, **kwargs)


@nox.session(python=main_python)
Expand Down Expand Up @@ -76,7 +64,6 @@ def pytype(session):
@nox.session(python=multi_python_versions_support)
def typeguard(session):
args = session.posargs
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(session, "pytest", "pytest-mock", "typeguard")
session.run("pytest", f"--typeguard-packages={package}", *args)

Expand All @@ -85,32 +72,30 @@ def typeguard(session):
def xdoctest(session: Session) -> None:
"""Run examples with xdoctest."""
args = session.posargs or ["all"]
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(session, "xdoctest")
session.run("python", "-m", "xdoctest", package, *args)


@nox.session(python=main_python)
def safety(session):
with tempfile.NamedTemporaryFile() as requirements:
session.run(
"poetry",
"export",
"--with",
"dev",
"--format=requirements.txt",
"--without-hashes",
f"--output={requirements.name}",
external=True,
)
install_with_constraints(session, "safety")
session.run("safety", "check", f"--file={requirements.name}", "--full-report")
# @nox.session(python=main_python)
# def safety(session):
# with tempfile.NamedTemporaryFile() as requirements:
# session.run(
# "poetry",
# "export",
# "--with",
# "dev",
# "--format=requirements.txt",
# "--without-hashes",
# f"--output={requirements.name}",
# external=True,
# )
# install_with_constraints(session, "safety")
# session.run("safety", "check", f"--file={requirements.name}", "--full-report")


@nox.session(python=multi_python_versions_support)
def tests(session):
args = session.posargs or ["--cov=adijif"]
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(
session,
"pytest",
Expand All @@ -120,7 +105,7 @@ def tests(session):
"gekko",
"numpy",
"cplex",
"docplex",
"docplex==2.23.222",
"coverage[toml]",
)
session.run("pytest", *args)
Expand All @@ -131,7 +116,6 @@ def testsp(session):
import os

args = [f"-n={os.cpu_count()}"] or ["--cov=adijif"]
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(
session,
"pytest",
Expand All @@ -152,7 +136,6 @@ def testsnb(session):
import os

args = ["--nbmake", "examples"]
session.run("poetry", "install", "--only", "main", external=True)
install_with_constraints(
session,
"pytest",
Expand Down
Loading

0 comments on commit 0ebbdc0

Please sign in to comment.