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 52b8ea5 commit c74d182
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 47 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
26 changes: 13 additions & 13 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,15 +36,15 @@ 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: FedericoCarboni/setup-ffmpeg@v2
- uses: actions/checkout@v4
- uses: FedericoCarboni/setup-ffmpeg@v3

- 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 @@ -55,16 +55,16 @@ jobs:
- name: Run tests
run: |
poetry run pytest -m "not network"
poetry run pytest
docs:
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 @@ -81,11 +81,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: FedericoCarboni/setup-ffmpeg@v2
- uses: actions/checkout@v4
- uses: FedericoCarboni/setup-ffmpeg@v3

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

Expand All @@ -99,4 +99,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
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 }}'
4 changes: 2 additions & 2 deletions moe_transcode/transcode_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pathlib import Path
from typing import Literal, Optional, TypeVar

import dynaconf
import dynaconf.base
import moe
from moe import config
from moe.library import Album, Track
Expand Down Expand Up @@ -36,7 +36,7 @@ def add_config_validator(settings: dynaconf.base.LazySettings):
)


I = TypeVar("I", Album, Track)
I = TypeVar("I", Album, Track) # noqa: E741
"""Type hint representing either an Album or a Track."""


Expand Down
24 changes: 12 additions & 12 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"]
"transcode" = "moe_transcode"
Expand Down Expand Up @@ -67,10 +67,10 @@ markers = [

[tool.pyright]
exclude = [
"alembic",
"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
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def extra_factory(
Created extra.
"""
album = album or album_factory(num_tracks=0, num_extras=0, exists=exists)
path = path or album.path / f"{random.randint(1,10000)}.txt"
path = path or album.path / f"{random.randint(1, 10000)}.txt"

extra = Extra(album=album, path=path, **kwargs)

Expand Down

0 comments on commit c74d182

Please sign in to comment.