Skip to content

Commit

Permalink
Switch to Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
Ch00k committed Feb 8, 2024
1 parent 7afdc59 commit cb8b7f6
Show file tree
Hide file tree
Showing 14 changed files with 816 additions and 313 deletions.
41 changes: 28 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,38 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: make lint
if: matrix.python-version == '3.11'
- run: make ci

- run: |
pip install pre-commit
pre-commit run --all-files
if: matrix.python-version == '3.12'
- run: |
pip install poetry
poetry install
- run: |
poetry run python tests/tools/authenticate.py
poetry run pytest -s
env:
D8Y_AUTH_CACHE_DATA: ${{ secrets.D8Y_AUTH_CACHE_DATA }}
- uses: codecov/codecov-action@v3
if: matrix.python-version == '3.11'
- uses: codecov/codecov-action@v4
if: matrix.python-version == '3.12'

# Update the secret with the data from D8Y_AUTH_CACHE_FILE in order to keep it in sync across test runs for
# different Python versions.
- id: capture_auth_cache_data
run: echo "AUTH_CACHE_DATA=$(cat $GITHUB_WORKSPACE/tests/data/auth)" >> $GITHUB_OUTPUT

- uses: gliech/create-github-secret-action@v1
with:
name: D8Y_AUTH_CACHE_DATA
Expand All @@ -51,11 +65,12 @@ jobs:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: make publish
python-version: "3.12"

- run: poetry publish --build
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
dist
.coverage
coverage.xml
tests/data/auth
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
default_language_version:
python: python3.10
python: python3.12

repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.1.1
hooks:
- id: black
args:
- --check
- --diff

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args:
- --check-only
- --diff

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- Flake8-pyproject==1.2.2
- Flake8-pyproject==1.2.3
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

35 changes: 0 additions & 35 deletions Makefile

This file was deleted.

1 change: 0 additions & 1 deletion discogrify/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = "0.0.11"
722 changes: 722 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

59 changes: 56 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
[tool.poetry]
name = "discogrify"
version = "0.0.12"
description = "Create discographies on Spotify"
authors = ["Andrii Yurchuk <ay@mntw.re>"]
license = "Unlicense"
readme = "README.md"
repository = "https://github.com/Ch00k/discogrify"
classifiers = [
"Topic :: Multimedia :: Sound/Audio",
"Development Status :: 4 - Beta",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: The Unlicense (Unlicense)",
"Natural Language :: English",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: POSIX :: BSD",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
]

keywords = ["spotify", "discography", "playlist"]

[tool.poetry.dependencies]
python = "^3.8.1" # flake8 >=7.0.0 needs Python >=3.8.1
click = "^8.1.7"
environs = "^10.3.0"
spotipy = "^2.23.0"
tabulate = "^0.9.0"

[tool.poetry.scripts]
discogrify = "discogrify.cli:cli"
d8y = "discogrify.cli:cli"

[tool.poetry.group.dev.dependencies]
black = "^24.1.1"
flake8 = "^7.0.0"
flake8-pyproject = "^1.2.3"
isort = "^5.13.2"
mypy = "^1.8.0"
pytest = "^8.0.0"
pytest-cov = "^4.1.0"
types-tabulate = "^0.9.0.20240106"

[tool.black]
line-length = 120

Expand Down Expand Up @@ -25,6 +76,8 @@ addopts = "--cov --cov-report xml"

[tool.coverage.run]
branch = true
omit = [
"**/*/test*/*"
]
omit = ["**/*/test*/*"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
12 changes: 0 additions & 12 deletions requirements-test.in

This file was deleted.

148 changes: 0 additions & 148 deletions requirements-test.txt

This file was deleted.

4 changes: 0 additions & 4 deletions requirements.in

This file was deleted.

Loading

0 comments on commit cb8b7f6

Please sign in to comment.