Skip to content

Commit

Permalink
chore: enable python 3.8 (and disable py 3.12)
Browse files Browse the repository at this point in the history
  • Loading branch information
kod-kristoff committed Mar 28, 2024
1 parent fc589de commit feb847d
Show file tree
Hide file tree
Showing 11 changed files with 811 additions and 774 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.9"
MINIMUM_PYTHON_VERSION: "3.8"

# If new code is pushed to a PR branch, then cancel in progress workflows for that PR. Ensures that
# we don't waste CI time, and returns results quicker https://github.com/jonhoo/rust-ci-conf/pull/5
Expand All @@ -22,7 +22,7 @@ concurrency:
jobs:
fmt:
runs-on: ubuntu-latest
name: ubuntu / 3.9 / fmt
name: ubuntu / 3.8 / fmt
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -49,7 +49,7 @@ jobs:
run: make check-fmt
lint:
runs-on: ubuntu-latest
name: ubuntu / 3.9 / lint
name: ubuntu / 3.8 / lint
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -72,7 +72,7 @@ jobs:
run: make lint
type-check:
runs-on: ubuntu-latest
name: ubuntu / 3.9 / type-check
name: ubuntu / 3.8 / type-check
steps:
- uses: actions/checkout@v4
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-kb-bert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.9"
MINIMUM_PYTHON_VERSION: "3.8"

jobs:
build:
# This action builds distribution files for upload to PyPI

name: ubuntu / 3.9 / build
name: ubuntu / 3.8 / build
runs-on: ubuntu-latest
steps:
#----------------------------------------------
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
# This action runs the test suite on the built artifact in the `build` action.
# The default is to run this in ubuntu, macos and windows

name: ${{ matrix.os }} / 3.9 / test built artifact
name: ${{ matrix.os }} / 3.8 / test built artifact
needs: [build]

strategy:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
# Cargo semver rules (i.e cargo does not update to a new major version unless explicitly told
# to).
runs-on: ubuntu-latest
continue-on-error: true # TODO remove this when python 3.8 is dropped
name: ubuntu / 3.12 / updates work
# There's no point running this if no Cargo.lock was checked in in the first place, since we'd
# just redo what happened in the regular test job. Unfortunately, hashFiles only works in if on
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:
contents: read

env:
MINIMUM_PYTHON_VERSION: "3.9"
MINIMUM_PYTHON_VERSION: "3.8"

jobs:

Expand All @@ -32,10 +32,11 @@ jobs:
os: [ubuntu]
python-version:
# remove the unused versions
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
# - "3.12" TODO enable this when py 3.8 is dropped

runs-on: ${{ matrix.os }}-latest
env:
Expand Down Expand Up @@ -87,7 +88,7 @@ jobs:
#

runs-on: ubuntu-latest
name: ubuntu / 3.9 / minimal-versions
name: ubuntu / 3.8 / minimal-versions
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -106,7 +107,7 @@ jobs:
run: make test

run-example:
name: ubuntu / 3.9 / run-example
name: ubuntu / 3.8 / run-example
runs-on: ubuntu-latest
steps:
- name: Check out repository
Expand Down
2 changes: 2 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy]
python_version = 3.8
544 changes: 277 additions & 267 deletions pdm.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "sparv-sbx-word-prediction-workspace"
dependencies = []
requires-python = ">=3.9"
requires-python = ">=3.8.1,<3.12"
version = "0.0.0"

[tool.pdm.dev-dependencies]
Expand Down
31 changes: 31 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
target-version = "py38"

[lint]
select = [
"A",
# "ANN",
"B",
"BLE",
"C4",
"C90",
# "D",
"E",
"F",
"FBT",
"I",
"RUF",
"S",
"YTT",
]

# Never enforce `E501` (line length violations).
# ignore = ["E501"]
ignore = ["ANN101", "ANN102","D203", "D213", "B008"]

# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]

# Ignore `E402` (import violations) in all `__init__.py` files, and in `path/to/file.py`.
[lint.per-file-ignores]
"**/tests/*" = ["D100","D101","D102","D103","D104","S101"]
# "__init__.py" = ["E402"]
492 changes: 251 additions & 241 deletions word-prediction-kb-bert/pdm.lock

Large diffs are not rendered by default.

16 changes: 5 additions & 11 deletions word-prediction-kb-bert/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ description = "A sparv plugin for computing word neighbours using a BERT model."
authors = [
{ name = "Kristoffer Andersson", email = "[email protected]" },
]
dependencies = [
"sparv-pipeline >=5.2.0",
"transformers>=4.34.1",
"tabulate>=0.9.0",
]
dependencies = ["sparv-pipeline >=5.2.0", "transformers>=4.34.1"]
license = "MIT"
readme = "README.md"
requires-python = ">= 3.9"
requires-python = ">= 3.8.1,<3.12"
classifiers = [
"Development Status :: 4 - Beta",
# "Development Status :: 5 - Production/Stable",
Expand All @@ -21,10 +17,11 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: POSIX",
# "Operating System :: Microsoft :: Windows",
"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",
# "Programming Language :: Python :: 3.12", TODO: fix this
"Programming Language :: Python :: Implementation :: CPython",
# "uncomment if you test on these interpreters:",
# "Programming Language :: Python :: Implementation :: IronPython",
Expand Down Expand Up @@ -56,7 +53,4 @@ allow-direct-references = true


[tool.pdm.dev-dependencies]
dev = [
"pytest>=8.0.0",
"syrupy>=4.6.1",
]
dev = ["pytest>=8.0.0", "syrupy>=4.6.1"]
Loading

0 comments on commit feb847d

Please sign in to comment.