Skip to content

Commit

Permalink
Updating dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
gandersen101 committed Mar 8, 2024
1 parent d0cc551 commit 7598384
Show file tree
Hide file tree
Showing 6 changed files with 1,329 additions and 1,261 deletions.
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
23 changes: 16 additions & 7 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,11 +15,15 @@
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_VERSION = "3.7.4"
SPACY_MYPY_VERSIONS = {SPACY_VERSION: PYTHONS, "3.2.6": PYTHONS}
SPACY_TEST_VERIONS = {SPACY_VERSION: PYTHONS, "3.0.9": ["3.10", "3.9", "3.8", "3.7"]}
RAPIDFUZZ_VERSION = "3.4.0"
RAPIDFUZZ_VERSIONS = {
"3.0.0": PYTHONS,
"3.6.2": ["3.11", "3.10", "3.9", "3.8"],
# 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"],
}
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 7598384

Please sign in to comment.