Skip to content

Commit

Permalink
deprecate 3.6, move actions 3.9 -> 3.10, remove legacy asyncio pytest…
Browse files Browse the repository at this point in the history
… decorators
  • Loading branch information
carlmontanari committed Jan 16, 2022
1 parent 95ece1d commit 4ab3e4b
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
max-parallel: 1
matrix:
os: [ubuntu-latest]
version: [3.9]
version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -27,10 +27,10 @@ jobs:
build_posix:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
max-parallel: 8
matrix:
os: [ubuntu-latest, macos-latest]
version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up python 3.9
- name: set up python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: 3.10
- name: setup publish env
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
max-parallel: 1
matrix:
os: [ubuntu-latest]
version: [3.9]
version: ["3.10"]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand All @@ -31,10 +31,10 @@ jobs:
build_posix:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 12
max-parallel: 8
matrix:
os: [ubuntu-latest, macos-latest]
version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: set up python ${{ matrix.version }}
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ Changelog

- Revised juniper abort config to remove candidate config file *after* rollback 0 to avoid issues where junos would
prompt for confirmation when exiting config mode to go delete the candidate config file prompting timeouts.
- Dropped Python3.6 support as it is now EOL! Of course, scrapli probably still works just fine with 3.6 (if you
install the old 3.6 requirements), but we won't test/support it anymore.
- Wow, pretty empty here... guess that's a good sign things have been working :p


## 2021.07.30
Expand Down
16 changes: 8 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def parse_requirements(dev: bool = True) -> Dict[str, str]:
]


@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"])
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
def unit_tests(session):
"""
Nox run unit tests
Expand Down Expand Up @@ -100,7 +100,7 @@ def unit_tests(session):
)


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def integration_tests(session):
"""
Nox run integration tests
Expand Down Expand Up @@ -137,7 +137,7 @@ def integration_tests(session):
)


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def isort(session):
"""
Nox run isort
Expand All @@ -156,7 +156,7 @@ def isort(session):
session.run("python", "-m", "isort", "-c", ".")


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def black(session):
"""
Nox run black
Expand All @@ -175,7 +175,7 @@ def black(session):
session.run("python", "-m", "black", "--check", ".")


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def pylama(session):
"""
Nox run pylama
Expand All @@ -194,7 +194,7 @@ def pylama(session):
session.run("python", "-m", "pylama", ".")


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def pydocstyle(session):
"""
Nox run pydocstyle
Expand All @@ -213,7 +213,7 @@ def pydocstyle(session):
session.run("python", "-m", "pydocstyle", ".")


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def mypy(session):
"""
Nox run mypy
Expand All @@ -233,7 +233,7 @@ def mypy(session):
session.run("python", "-m", "mypy", "--strict", "scrapli_cfg/")


@nox.session(python=["3.9"])
@nox.session(python=["3.10"])
def darglint(session):
"""
Nox run darglint
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[tool.black]
line-length = 100
target-version = ['py310']

[tool.pytest.ini_options]
asyncio_mode = "auto"
7 changes: 3 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ mypy==0.931
nox==2022.01.07
pycodestyle==2.8.0
pydocstyle==6.1.1
pyfakefs==4.5.3
pylama==7.7.1 ; python_version < "3.7"
pylama==8.3.6 ; python_version >= "3.7"
pyfakefs==4.5.4
pylama==8.3.7
pylint==2.12.2
pytest-asyncio==0.16.0
pytest-asyncio==0.17.0
pytest-cov==3.0.0
pytest==6.2.5
scrapli-replay==2021.7.30
Expand Down
2 changes: 1 addition & 1 deletion requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mdx-gh-links==0.2
mkdocs==1.2.3
mkdocs-material==8.1.4
mkdocs-material==8.1.6
mkdocs-material-extensions==1.0.3
pdoc3==0.10.0 ; sys_platform != "win32"
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,14 @@ def get_packages(package):
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Python Modules",
],
python_requires=">=3.6",
python_requires=">=3.7",
# zip_safe False for mypy
# https://mypy.readthedocs.io/en/stable/installed_packages.html
zip_safe=False,
Expand Down
1 change: 0 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ async def async_conn(test_devices_dict, device_type, async_transport):
return async_conn, device_type


@pytest.mark.asyncio
@pytest.fixture(scope="function")
async def async_cfg_conn(config_replacer_dict, async_conn, expected_configs):
scrapli_conn, device_type = async_conn
Expand Down
3 changes: 0 additions & 3 deletions tests/integration/platform/test_core_platforms_async.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import pytest


@pytest.mark.asyncio
@pytest.mark.scrapli_replay
async def test_get_config(async_cfg_conn):
await async_cfg_conn.prepare()
Expand All @@ -13,7 +12,6 @@ async def test_get_config(async_cfg_conn):
)


@pytest.mark.asyncio
@pytest.mark.scrapli_replay
async def test_load_config_merge_diff_and_abort(async_cfg_conn):
await async_cfg_conn.prepare()
Expand All @@ -28,7 +26,6 @@ async def test_load_config_merge_diff_and_abort(async_cfg_conn):
# dont bother with checking the diff itself, we'll do that in unit tests much more thoroughly


@pytest.mark.asyncio
@pytest.mark.scrapli_replay
async def test_load_config_merge_diff_and_commit(async_cfg_conn):
await async_cfg_conn.prepare()
Expand Down
6 changes: 0 additions & 6 deletions tests/unit/platform/base/test_async_platform.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import pytest

from scrapli_cfg.response import ScrapliCfgResponse


@pytest.mark.asyncio
async def test_open(async_cfg_object, monkeypatch):
open_called = False
get_version_called = False
Expand Down Expand Up @@ -49,7 +46,6 @@ async def _on_prepare(cls):
assert on_prepare_called is True


@pytest.mark.asyncio
async def test_close(async_cfg_object, monkeypatch):
close_called = False

Expand All @@ -70,7 +66,6 @@ async def _close(cls):
assert close_called is True


@pytest.mark.asyncio
async def test_context_manager(monkeypatch, async_cfg_object):
"""Asserts context manager properly opens/closes"""
open_called = False
Expand Down Expand Up @@ -98,7 +93,6 @@ async def _cleanup(cls):
assert close_called is True


@pytest.mark.asyncio
async def test_render_substituted_config(monkeypatch, async_cfg_object):
"""Asserts context manager properly opens/closes"""
get_config_called = False
Expand Down

0 comments on commit 4ab3e4b

Please sign in to comment.