Skip to content

Commit

Permalink
Merge pull request #83 from gandersen101/testing/updating-deps-to-tes…
Browse files Browse the repository at this point in the history
…t-against

Updating Dependencies to Test Against
  • Loading branch information
gandersen101 committed Mar 11, 2024
2 parents d0cc551 + 3126e1e commit a0897b0
Show file tree
Hide file tree
Showing 7 changed files with 1,333 additions and 1,265 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
python-version: '3.11'
architecture: x64
- name: Install Root Dependencies
run: pip install nox poetry
- name: Generate Coverage Report
run: nox --session "tests-3.10(spacy='3.5.2', rapidfuzz='3.0.0')" -- --cov --cov-report=xml
run: nox --session "tests-3.11(spacy='3.7.4', rapidfuzz='3.6.2')" -- --cov --cov-report=xml
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
28 changes: 22 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -94,6 +94,21 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

Expand Down Expand Up @@ -137,15 +152,16 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Pyenv
.python-version
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# VSCode
.vscode
*.code-workspace

# Mac
.DS_Store

# Notebooks
example*/
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ repos:
args: ["--markdown-linebreak-ext=md"]
- repo: local
hooks:
- id: poetry-check
name: poetry-check
entry: poetry check --lock
always_run: true
pass_filenames: false
language: system
- id: isort
name: isort
entry: poetry run isort
Expand Down
27 changes: 18 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"""Nox sessions."""
"""Nox sessions.
Even though `nox` is part of the full spaczz dev-install, nothing outside of the stdlib
and `nox` itself should be imported in this module. This is because CI won't have any
other dependencies installed at the time of calling `nox`.
"""
from itertools import product

import nox
Expand All @@ -10,13 +15,17 @@
LOCATIONS = "src", "tests", "./noxfile.py", "docs/conf.py"
PYTHON = "3.11"
PYTHONS = ["3.11", "3.10", "3.9", "3.8", "3.7"]
SPACY_VERSION = "3.5.2"
SPACY_MYPY_VERSIONS = {SPACY_VERSION: PYTHONS, "3.1.7": PYTHONS}
SPACY_TEST_VERIONS = {SPACY_VERSION: PYTHONS, "3.0.9": ["3.10", "3.9", "3.8", "3.7"]}
SPACY_VERSION = "3.7.4"
SPACY_MYPY_VERSIONS = {SPACY_VERSION: PYTHONS, "3.2.6": PYTHONS[1:]}
SPACY_TEST_VERIONS = {SPACY_VERSION: PYTHONS, "3.0.9": PYTHONS[1:]}
RAPIDFUZZ_VERSION = "3.4.0"
RAPIDFUZZ_VERSIONS = {
"3.0.0": PYTHONS,
"3.6.2": PYTHONS[:-1],
# rapidfuzz dropped Python 3.7 support at v3.5, but the spaczz
# locked version is v3.4, which still supports Python 3.7 like spaczz does.
RAPIDFUZZ_VERSION: PYTHONS,
"2.15.1": PYTHONS,
"1.9.1": ["3.10", "3.9", "3.8", "3.7"],
"1.9.1": PYTHONS[1:],
}


Expand All @@ -27,15 +36,15 @@
def isort(session: Session) -> None:
"""Run isort import formatter."""
args = session.posargs or LOCATIONS
session.run("poetry", "install", "--only", "isort", external=True)
session.run("poetry", "install", "--no-root", "--only", "isort", external=True)
session.run("isort", *args)


@nox.session(python=PYTHON)
def black(session: Session) -> None:
"""Run black code formatter."""
args = session.posargs or LOCATIONS
session.run("poetry", "install", "--only", "black", external=True)
session.run("poetry", "install", "--no-root", "--only", "black", external=True)
session.run("black", *args)


Expand All @@ -46,7 +55,7 @@ def black(session: Session) -> None:
def lint(session: Session) -> None:
"""Lint using flake8."""
args = session.posargs or LOCATIONS
session.run("poetry", "install", "--only", "lint", external=True)
session.run("poetry", "install", "--no-root", "--only", "lint", external=True)
session.run("flake8", *args)


Expand Down
Loading

0 comments on commit a0897b0

Please sign in to comment.