Skip to content

Commit

Permalink
chore: add --pre flag for (python) pre-release build
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Jul 28, 2024
1 parent 05b0c17 commit ae63856
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pre_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on:
schedule:
# weekly at 0300 PST/1000 UTC on Sunday
- cron: '0 10 * * 0'
# commented out till 3.13
# workflow_dispatch:
workflow_dispatch: {}

jobs:
build_posix:
Expand All @@ -32,8 +31,8 @@ jobs:
python -m pip install --upgrade setuptools wheel
python -m pip install nox
- name: run nox
# TERM is needed needed to make the terminal a tty (i think? without this system ssh is super broken)
# TERM is needed to make the terminal a tty (i think? without this system ssh is super broken)
# libssh2/ssh2-python were getting libssh2 linked incorrectly/weirdly and libraries were trying to be loaded
# from the temp dir that pip used for installs. setting the DYLD_LIBRARY_PATH envvar seems to solve this -- note
# that if brew macos packages get updated on runners this may break again :)
run: TERM=xterm DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/libssh2/1.11.0_1/lib python -m nox -p $FRIENDLY_PYTHON_VERSION -k "not darglint"
run: TERM=xterm DYLD_LIBRARY_PATH=/opt/homebrew/Cellar/libssh2/1.11.0_1/lib PRE_RELEASE=1 python -m nox -p $FRIENDLY_PYTHON_VERSION -k "not darglint"
19 changes: 17 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""scrapli_replay.noxfile"""

import os
import re
import sys
from pathlib import Path
Expand All @@ -11,6 +12,8 @@
nox.options.stop_on_first_error = False
nox.options.default_venv_backend = "venv"

PRE = bool(os.environ.get("PRE_RELEASE"))


def parse_requirements(dev: bool = True) -> Dict[str, str]:
"""
Expand Down Expand Up @@ -64,6 +67,18 @@ def parse_requirements(dev: bool = True) -> Dict[str, str]:
SKIP_LIST: List[str] = []


def _get_install_test_args() -> List[str]:
args = [".[dev]"]

if sys.platform == "darwin":
args = [".[dev-darwin]"]

if PRE:
args.append("--pre")

return args


@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"])
def unit_tests(session):
"""
Expand All @@ -83,7 +98,7 @@ def unit_tests(session):
return

session.install("-U", "setuptools", "wheel", "pip")
session.install(".[dev]")
session.install(*_get_install_test_args())
session.run(
"python",
"-m",
Expand Down Expand Up @@ -153,7 +168,7 @@ def pylama(session):
N/A
"""
session.install(".[dev]")
session.install(*_get_install_test_args())
session.run("python", "-m", "pylama", ".")


Expand Down

0 comments on commit ae63856

Please sign in to comment.