Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
list_nox_test_sessions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.12
architecture: x64

- name: Install noxfile requirements
Expand Down Expand Up @@ -49,11 +49,11 @@ jobs:
- uses: actions/checkout@v2

# Conda install
- name: Install conda v3.7
uses: conda-incubator/setup-miniconda@v2
- name: Install conda v3.12
uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
python-version: 3.7
python-version: 3.12
activate-environment: noxenv
- run: conda info
shell: bash -l {0} # so that conda works
Expand Down Expand Up @@ -85,10 +85,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install conda v3.7
uses: conda-incubator/setup-miniconda@v2
- name: Install conda v3.12
uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.10'
python-version: '3.12'
activate-environment: noxenv

- name: Install noxfile requirements
Expand Down Expand Up @@ -118,11 +118,11 @@ jobs:
path: ./docs/reports

# Conda install
- name: Install conda v3.7
uses: conda-incubator/setup-miniconda@v2
- name: Install conda v3.12
uses: conda-incubator/setup-miniconda@v3
with:
# auto-update-conda: true
python-version: 3.7
python-version: 3.12
activate-environment: noxenv
- run: conda info
shell: bash -l {0} # so that conda works
Expand Down
13 changes: 6 additions & 7 deletions ci_tools/nox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
nox_logger = logging.getLogger("nox")


PY27, PY35, PY36, PY37, PY38, PY39, PY310 = "2.7", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10"
PY38, PY39, PY310, PY311, PY312 = "3.8", "3.9", "3.10", "3.11", "3.12"
DONT_INSTALL = "dont_install"


Expand Down Expand Up @@ -713,14 +713,13 @@ async def async_popen():
# bind the out and err streams - see https://stackoverflow.com/a/59041913/7262247
# to mimic nox behaviour we only use a single capturing list
outlines = []
await asyncio.wait([
async with asyncio.TaskGroup() as tg:
# process out is only redirected to STDOUT if not silent
_read_stream(process.stdout, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=silent, verbosepipe=sys.stdout)),
tg.create_task(_read_stream(process.stdout, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=silent, verbosepipe=sys.stdout)))
# process err is always redirected to STDOUT (quiet=False) with a specific label
_read_stream(process.stderr, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=False, verbosepipe=sys.stdout, label="ERR:"))
])
tg.create_task(_read_stream(process.stderr, lambda l: tee(l, sinklist=outlines, sinkstream=log_file_stream,
quiet=False, verbosepipe=sys.stdout, label="ERR:")))
return_code = await process.wait() # make sur the process has ended and retrieve its return code
return return_code, outlines

Expand Down
2 changes: 1 addition & 1 deletion noxfile-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nox
nox~=2023.4.22
toml
makefun
setuptools_scm # used in 'release'
Expand Down
19 changes: 8 additions & 11 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,20 @@
# add parent folder to python path so that we can import noxfile_utils.py
# note that you need to "pip install -r noxfile-requiterements.txt" for this file to work.
sys.path.append(str(Path(__file__).parent / "ci_tools"))
from nox_utils import PY27, PY37, PY36, PY35, PY38, PY39, PY310, power_session, rm_folder, rm_file, PowerSession # noqa
from nox_utils import PY38, PY39, PY310, PY311, PY312, power_session, rm_folder, rm_file, PowerSession # noqa


pkg_name = "decopatch"
gh_org = "smarie"
gh_repo = "python-decopatch"

ENVS = {
# python 3.10 is not available on conda yet
# PY310: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY312: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY311: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY310: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY39: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY38: {"coverage": False, "pkg_specs": {"pip": ">19"}},
PY27: {"coverage": False, "pkg_specs": {"pip": ">10"}},
PY35: {"coverage": False, "pkg_specs": {"pip": ">10"}},
PY36: {"coverage": False, "pkg_specs": {"pip": ">19"}},
# IMPORTANT: this should be last so that the folder docs/reports is not deleted afterwards
PY37: {"coverage": True, "pkg_specs": {"pip": ">19"}}, # , "pytest-html": "1.9.0"
PY38: {"coverage": True, "pkg_specs": {"pip": ">19"}}, # , "pytest-html": "1.9.0"
}

# set the default activated sessions, minimal for CI
Expand Down Expand Up @@ -176,7 +173,7 @@ def flake8(session: PowerSession):
rm_file(Folders.flake8_intermediate_file)


@power_session(python=[PY37])
@power_session(python=[PY38])
def docs(session: PowerSession):
"""Generates the doc and serves it on a local http server. Pass '-- build' to build statically instead."""

Expand All @@ -189,7 +186,7 @@ def docs(session: PowerSession):
session.run2("mkdocs serve")


@power_session(python=[PY37])
@power_session(python=[PY38])
def publish(session: PowerSession):
"""Deploy the docs+reports on github pages. Note: this rebuilds the docs"""

Expand All @@ -214,7 +211,7 @@ def publish(session: PowerSession):
# session.run2('codecov -t %s -f %s' % (codecov_token, Folders.coverage_xml))


@power_session(python=[PY37])
@power_session(python=[PY38])
def release(session: PowerSession):
"""Create a release on github corresponding to the latest tag"""

Expand Down
23 changes: 8 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@ classifiers =
License :: OSI Approved :: BSD License
Topic :: Software Development :: Libraries :: Python Modules
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
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.11
Programming Language :: Python :: 3.12

[options]
# one day these will be able to come from requirement files, see https://github.com/pypa/setuptools/issues/1951. But will it be better ?
Expand All @@ -40,16 +37,12 @@ install_requires =
funcsigs;python_version<'3.3'
enum34;python_version<'3.4'
tests_require =
pytest
pytest_cases
pytest~=8.2.1
pytest_cases~=3.8.5
# syrupy, pyright and mypy is used for testing type correctness.
syrupy>2;python_version>'3.6'
pyright;python_version>'3.6'
mypy;python_version>'3.6'
# for some reason these pytest dependencies were not declared in old versions of pytest
six;python_version<'3.6'
attr;python_version<'3.6'
pluggy;python_version<'3.6'
syrupy~=4.6.1
pyright==1.1.365
mypy~=1.10.0

# test_suite = tests --> no need apparently
#
Expand Down
10 changes: 4 additions & 6 deletions tests/pyright/__snapshots__/test_typing.ambr
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This file is generated by [syrupy](https://github.com/tophat/syrupy),
# do not edit manually.
# To update - run `pytest --snapshot-update`
# serializer version: 1
# name: test_typing
list([
dict({
Expand All @@ -18,7 +16,7 @@
'line': 15,
}),
}),
'rule': 'reportGeneralTypeIssues',
'rule': 'reportCallIssue',
'severity': 'error',
}),
dict({
Expand All @@ -36,7 +34,7 @@
'line': 36,
}),
}),
'rule': 'reportGeneralTypeIssues',
'rule': 'reportArgumentType',
'severity': 'error',
}),
dict({
Expand All @@ -54,7 +52,7 @@
'line': 52,
}),
}),
'rule': 'reportGeneralTypeIssues',
'rule': 'reportArgumentType',
'severity': 'error',
}),
])
Expand Down