diff --git a/.copier-answers.yml b/.copier-answers.yml index 67a876e..222ba68 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # Changes here will be overwritten by Copier -_commit: 0.1.55 +_commit: 0.1.66 _src_path: git@bbpgitlab.epfl.ch:neuromath/python-template.git author_name: Blue Brain Project, EPFL copyright_license: Apache License 2.0 diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index 0adb8fc..14a08fc 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -8,6 +8,8 @@ jobs: check-pr-title: name: Check PR title runs-on: ubuntu-latest + env: + PR_TITLE: ${{ github.event.pull_request.title }} steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -16,4 +18,4 @@ jobs: - run: npm install -g --force commitlint @commitlint/cli commitlint-plugin-cleanfeet - run: npm install conventional-changelog-conventionalcommits - run: touch .git/COMMIT_EDITMSG - - run: echo "${{ github.event.pull_request.title }}" | commitlint + - run: echo "$PR_TITLE" | commitlint diff --git a/.github/workflows/publish-sdist.yml b/.github/workflows/publish-sdist.yml index 85abdf9..362a947 100644 --- a/.github/workflows/publish-sdist.yml +++ b/.github/workflows/publish-sdist.yml @@ -11,10 +11,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: "3.10" - name: Build a wheel and a source tarball run: | pip install setuptools>=42 build setuptools_scm[toml]>=3.4 diff --git a/.github/workflows/run-tox.yml b/.github/workflows/run-tox.yml index a22e09b..70e9c99 100644 --- a/.github/workflows/run-tox.yml +++ b/.github/workflows/run-tox.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] min_versions: ["min_versions", "latest_versions"] exclude: - min_versions: "min_versions" include: - - python-version: "3.8" + - python-version: "3.9" min_versions: "min_versions" steps: @@ -55,7 +55,7 @@ jobs: pip install tox tox run -e min_versions - name: JUnit Report Action - uses: mikepenz/action-junit-report@v4 + uses: mikepenz/action-junit-report@v5 if: always() # always run even if the previous step fails with: report_paths: 'reports/pytest-*.xml' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6fa9e94..6e8187f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,8 +1,6 @@ -default_language_version: - python: python3.8 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -13,22 +11,22 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.5.0 + rev: v9.18.0 hooks: - id: commitlint stages: - commit-msg additional_dependencies: ['conventional-changelog-conventionalcommits'] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black - rev: 23.9.1 + rev: 24.10.0 hooks: - id: black - repo: https://github.com/codespell-project/codespell - rev: v2.2.5 + rev: v2.3.0 hooks: - id: codespell args: ["-x", ".codespellignorelines"] @@ -38,6 +36,6 @@ repos: - id: pydocstyle additional_dependencies: ["tomli"] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.1.1 hooks: - id: flake8 diff --git a/.pylintrc b/.pylintrc index 62a6d26..3b4185e 100644 --- a/.pylintrc +++ b/.pylintrc @@ -3,7 +3,8 @@ disable= fixme, invalid-name, len-as-condition, - no-else-return + no-else-return, + too-many-positional-arguments [FORMAT] # Regexp for a line that is allowed to be longer than the limit. diff --git a/.readthedocs.yml b/.readthedocs.yml index c51d15e..91cce21 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -6,9 +6,9 @@ version: 2 build: - os: ubuntu-20.04 + os: ubuntu-22.04 tools: - python: "3.9" + python: "3.11" sphinx: configuration: docs/source/conf.py diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fff4259..f89530a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,7 +59,7 @@ When you wish to contribute to the code base, please consider the following guid or ```shell - tox -e py38 -e lint -e docs -e check-packaging + tox run -e py39,lint,docs,check-packaging ``` * Commit your changes using a descriptive commit message. diff --git a/docs/source/conf.py b/docs/source/conf.py index e5d275b..8812673 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -29,10 +29,11 @@ # -- Project information ----------------------------------------------------- -project = "BluePyParallel" +project_name = "BluePyParallel" +package_name = "BluePyParallel" # The short X.Y version -version = metadata.version("BluePyParallel") +version = metadata.version(package_name) # The full version, including alpha/beta/rc tags release = version @@ -76,10 +77,10 @@ # html_static_path = ['_static'] html_theme_options = { - "metadata_distribution": "BluePyParallel", + "metadata_distribution": package_name, } -html_title = project +html_title = project_name # If true, links to the reST sources are added to the pages. html_show_sourcelink = False diff --git a/pyproject.toml b/pyproject.toml index a8775e6..4a07da8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,14 +5,13 @@ authors = [ ] description = "Provides an embarrassingly parallel tool with sql backend." readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.9" license = { text = "Apache License 2.0" } classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -45,8 +44,8 @@ test = [ "packaging>=20", "pytest>=6.1", "pytest-benchmark>=3.4", - "pytest-cov>=3", - "pytest-html>=3.1", + "pytest-cov>=4.1", + "pytest-html>=3.2", ] [project.urls] @@ -69,10 +68,10 @@ include = ["bluepyparallel*"] [tool.black] line-length = 100 target-version = [ - "py38", "py39", "py310", "py311", + "py312", ] [tool.pydocstyle] diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 0fce54f..450f9da 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -60,10 +60,11 @@ def dict_data(): def data(request, int_data, dict_data): """Fixture for simple data depending of the type (range or dict).""" if request.param == "range": - values = deepcopy(int_data), _evaluation_function_range + return deepcopy(int_data), _evaluation_function_range elif request.param == "dict": - values = deepcopy(dict_data), _evaluation_function_dict - return values + return deepcopy(dict_data), _evaluation_function_dict + else: + raise ValueError(f"Unknown value '{request.param}'") def expected_results(data, func, *args, **kwargs): diff --git a/tox.ini b/tox.ini index 37d25ac..1d11fa2 100644 --- a/tox.ini +++ b/tox.ini @@ -8,7 +8,7 @@ envlist = lint docs min_versions - py{38,39,310,311} + py{39,310,311,312} coverage minversion = 3.18 @@ -19,15 +19,10 @@ allowlist_externals = extras = test setenv = COVERAGE_FILE = {env:COVERAGE_FILE:.coverage-{envname}} -deps = - min_versions: Requirements-Builder commands_pre = - min_versions: requirements-builder --level=min --extras=test -o {envtmpdir}/requirements_min.txt setup.py - min_versions: pip install -r {envtmpdir}/requirements_min.txt - min_versions: pip freeze +commands = - ipcluster stop --cluster-id={[base]name}_{envname} --signal 9 --debug ipcluster start -n 2 --daemonize --log-to-file --cluster-id={[base]name}_{envname} --debug -commands = pytest \ --basetemp={envtmpdir} \ --cov={[base]name} \ @@ -40,10 +35,11 @@ commands = --html reports/pytest-{envname}.html \ --junit-xml=reports/pytest-{envname}.xml \ --self-contained-html \ + --durations 10 \ + --durations-min=2.0 \ --benchmark-skip \ -k "not TestBenchmark" \ {posargs} -commands_post = - ipcluster stop --cluster-id={[base]name}_{envname} --signal 9 --debug [testenv:coverage] @@ -69,10 +65,16 @@ commands_pre = commands_post = [testenv:min_versions] -basepython = python3.8 +basepython = python3.9 +deps = + Requirements-Builder +commands_pre = + requirements-builder --level=min --extras=test -o {envtmpdir}/requirements_min.txt setup.py + pip install -r {envtmpdir}/requirements_min.txt + pip freeze [testenv:lint] -basepython = python3.8 +basepython = python3.9 deps = pre-commit pylint @@ -83,7 +85,7 @@ commands_pre = commands_post = [testenv:format] -basepython = python3.8 +basepython = python3.9 skip_install = true deps = codespell @@ -107,7 +109,7 @@ commands_post = [gh-actions] python = - 3.8: py38, lint - 3.9: py39, docs + 3.9: py39, lint 3.10: py310, check-packaging - 3.11: py311 + 3.11: py311, docs + 3.12: py312