Skip to content

Commit

Permalink
build: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpavlock committed Apr 6, 2024
1 parent d5fd836 commit 19d00f5
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 42 deletions.
5 changes: 4 additions & 1 deletion .github/scripts/prep_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def prepare_release_pr(token: str) -> None:
)

repo = login(token)
assert repo
repo.create_pull(
f"Prepare release {new_version}",
base="main",
Expand Down Expand Up @@ -218,10 +219,12 @@ def generate_changelog(old_version: str, new_version: str) -> None:
f.writelines(contents)


def login(token: str) -> Repository:
def login(token: str) -> Repository | None:
"""Logins to github and returns the working repository."""
github = github3.login(token=token)
assert github
owner, repo = SLUG.split("/")

return github.repository(owner, repo)


Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand All @@ -36,14 +36,14 @@ jobs:
runs-on: ${{ matrix.platform }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
platform: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -60,10 +60,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand All @@ -80,10 +80,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand All @@ -97,4 +97,4 @@ jobs:
poetry run pytest -v --cov=moe --cov-report=xml
- name: Upload test coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
4 changes: 2 additions & 2 deletions .github/workflows/prep_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ jobs:
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "mrmoe"
project-slug: "moe-musicbrainz"
22 changes: 14 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand Down Expand Up @@ -53,11 +53,17 @@ jobs:
pypi_release:
if: contains(github.event.head_commit.message, 'release:')
runs-on: ubuntu-latest

permissions:
# required for trusted publishing
id-token: write
contents: read

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"

Expand All @@ -67,9 +73,9 @@ jobs:
- name: Build
run: |
poetry build
- name: Mint token
id: mint
uses: tschm/token-mint-action@v1.0.3
- name: Publish to PyPI
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
poetry publish --username $PYPI_USERNAME --password $PYPI_PASSWORD
poetry publish -u __token__ -p '${{ steps.mint.outputs.api-token }}'
2 changes: 1 addition & 1 deletion moe_musicbrainz/mb_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pathlib import Path
from typing import Any, Callable, Optional, cast

import dynaconf
import dynaconf.base
import mediafile
import moe
import musicbrainzngs
Expand Down
25 changes: 14 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,35 @@ license = "MIT"
readme = "README.rst"

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python = ">=3.9,<3.13"
moe = "^2.0.0"

[tool.poetry.group.test.dependencies]
debugpy = "^1.4.1"
pytest = "^6.0.1"
pytest-cov = "^2.10.0"
pytest = "^8.0.0"
pytest-cov = "^4.0.0"

[tool.poetry.group.lint.dependencies]
black = "^22.6.0"
commitizen = "^2.17.12"
black = "^24.0.0"
commitizen = "^3.0.0"
darglint = "^1.8.1"
flake8 = "^5.0.4"
flake8-alphabetize = "^0.0.17"
flake8-bugbear = "^22.7.1"
flake8 = "^7.0.0"
flake8-alphabetize = "^0.0.19"
flake8-bugbear = "^24.0.0"
flake8-comprehensions = "^3.10.0"
flake8-docstrings = "^1.5.0"
flake8-pytest-style = "^1.6.0"
flake8-use-fstring = "^1.1"
"github3.py" = "^3.2.0"
isort = "^5.10.1"
mccabe = "^0.7.0"
pre-commit = "^2.6.0"
pre-commit = "^3.0.0"
pyright = "^1.1.267"

[tool.poetry.group.docs.dependencies]
furo = "*"
pypandoc = "^1.9"
Sphinx = "^5.2.3"
Sphinx = "^7.0.0"

[tool.poetry.plugins."moe.plugins"]
"musicbrainz" = "moe_musicbrainz"
Expand Down Expand Up @@ -66,8 +66,11 @@ markers = [
]

[tool.pyright]
exclude = [
"alembic", "tests"
]
pythonPlatform = "All"

[build-system]
requires = ["poetry-core"]
requires = ["poetry-core>=1.0"]
build-backend = "poetry.core.masonry.api"
27 changes: 19 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,29 @@ select =
PT, # pytest style
W6, # pycodestyle deprecation warnings
ignore =
PT001, # allow `@pytest.fixture` (no parens)
PT023, # allow `@pytest.mark.foo` (no parens)
B950, # bug-bear line length; just use flake8 line length limit
E203, # whitespace before ':' (black conflict)
E266, # too many leading '#' for block comment
E741, # ambiguous variable names I, O, etc. (use a better font)
DAR402, # Excess exceptions in "Raises" (I like to document sub-private-methods)
# allow `@pytest.fixture` (no parens)
PT001,
# allow `@pytest.mark.foo` (no parens)
PT023,
# bug-bear line length; just use flake8 line length limit
B950,
# whitespace before ':' (black conflict)
E203,
# Excess exceptions in "Raises" (I like to document sub-private-methods)
DAR402,
# too many leading '#' for block comment
E266,
per-file-ignores =
# E800: config file has commented out code as examples
alembic/env.py:E800
# D1: database migrations don't need docstrings
# I: isort errors tend to misinterpret alembic as a local package
alembic/versions/*.py:D1,I
# B907: manually specified quotes are usually intentional for testing purposes
# C901: don't check complexity for tests
# DAR101: pytest uses fixtures as arguments, documenting each use is unnecessary
# DAR102: factory arguments with fixtures can be weird
tests/*:C901,DAR101,DAR102
tests/*:B907,C901,DAR101,DAR102
# F401: import unused
# F403: allow * imports (used for packaging in some cases)
*/__init__.py:F401,F403

0 comments on commit 19d00f5

Please sign in to comment.