Skip to content

Commit

Permalink
migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
vm86 committed Oct 27, 2024
1 parent 1fa2c5e commit f411e15
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 166 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
- run: |
date > generated.txt
git tag -l --contains HEAD > TAG
git describe --tags > REVISIONS || echo > REVISIONS
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -31,14 +29,22 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install build ruff mypy
sudo apt install fuse3 libfuse3-dev libfuse-dev -y
python -m pip install -e .
- name: Lint with ruff
sudo apt install fuse3 libfuse3-dev libfuse-dev ffmpeg -y
python -m pip install -e ".[lint]"
- name: Test with pytest
run: |
python -m pip install -e ".[test]"
pytest
- name: Lint code with Ruff
run: |
ruff check --output-format=github
- name: Check code formatting with Ruff
run: |
ruff check
- name: Lint with mypy
ruff format --diff
- name: Lint code with mypy
run: |
mypy yandex_fuse
mypy tests
- name: Build package
run: python -m build
- name: Release
Expand Down
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Byte-compiled / optimized / DLL files
# Byte-compiled / optimized
.idea
*.iml
__pycache__/
Expand Down Expand Up @@ -50,4 +50,7 @@ ENV/
# ruff
.ruff_cache

VERSION
yandex_fuse/_version.py

# coverage
*.coverage
9 changes: 0 additions & 9 deletions .mypy.ini

This file was deleted.

92 changes: 92 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
[build-system]
requires = ["setuptools >= 65.0", "setuptools-scm >= 8"]
build-backend = "setuptools.build_meta"

[project]
name = "yandex-fuse"
dynamic = ["version"]
description = "Yandex Music Fuse FS"
readme = "README.md"
authors = [{ name = "Roman Nebaluev" }]
license = { text = "LGPLv3" }
keywords = ["yandex", "music", "fuse", "filesystem"]

dependencies = ["yandex-music >=2.2.0", "mutagen >=1.47.0", "pyfuse3 >=3.4.0"]
requires-python = ">=3.10"

[project.optional-dependencies]
test = ["pytest", "coverage", "pytest-cov"]
lint = ["mypy", "ruff"]

[project.scripts]
yamusic-fs = "yandex_fuse.main:main"

[tool.setuptools]
zip-safe = false
include-package-data = true

[tool.setuptools.packages.find]
include = ["yandex_fuse"]

[tool.setuptools.package-data]
"yandex_fuse" = ["contrib/*"]

[tool.setuptools_scm]
version_file = "yandex_fuse/_version.py"

[tool.pytest.ini_options]
pythonpath = "yandex_fuse"
addopts = "--cov --cov-report term-missing:skip-covered -v -s"
testpaths = ["tests"]

[tool.ruff]
target-version = "py310"
line-length = 80
indent-width = 4

[tool.ruff.lint]
# https://docs.astral.sh/ruff/rules/#legend
select = ["ALL"]
# D10* Missing docstring
ignore = [
"D10",
"D204",
"D203",
"D211",
"D212",
"D213",
"EM101",
"EM102",
"ERA001",
"FBT002",
"FBT003",
"FIX002",
"PT001",
"PT023",
"Q001",
"TD003",
"TRY003",
"COM812",
"ISC001",
"S603",
"S607",
]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = '^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$'

[tool.ruff.lint.flake8-quotes]
inline-quotes = "double"

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = false

[tool.mypy]
python_version = "3.10"
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
strict_equality = true
strict = true
pretty = true
41 changes: 0 additions & 41 deletions ruff.toml

This file was deleted.

32 changes: 0 additions & 32 deletions setup.cfg

This file was deleted.

73 changes: 0 additions & 73 deletions setup.py

This file was deleted.

0 comments on commit f411e15

Please sign in to comment.