Migrate from setup.* to pyproject.toml
This commit is contained in:
parent
54a9f04f8f
commit
98943d606e
5
.github/workflows/deploy.yml
vendored
5
.github/workflows/deploy.yml
vendored
|
@ -22,9 +22,9 @@ jobs:
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.x"
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: setup.cfg
|
cache-dependency-path: pyproject.toml
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
@ -33,7 +33,6 @@ jobs:
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
python setup.py --version
|
|
||||||
python -m build
|
python -m build
|
||||||
twine check --strict dist/*
|
twine check --strict dist/*
|
||||||
|
|
||||||
|
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
|
@ -22,7 +22,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
cache: pip
|
cache: pip
|
||||||
cache-dependency-path: setup.cfg
|
cache-dependency-path: pyproject.toml
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
@ -48,7 +48,7 @@ jobs:
|
||||||
success:
|
success:
|
||||||
needs: test
|
needs: test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: test successful
|
name: Test successful
|
||||||
steps:
|
steps:
|
||||||
- name: Success
|
- name: Success
|
||||||
run: echo Test successful
|
run: echo Test successful
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v2.34.0
|
rev: v2.38.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py37-plus]
|
args: [--py37-plus]
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 22.6.0
|
rev: 22.8.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: [--target-version=py37]
|
args: [--target-version=py37]
|
||||||
|
@ -16,7 +16,7 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: blacken-docs
|
- id: blacken-docs
|
||||||
args: [--target-version=py37]
|
args: [--target-version=py37]
|
||||||
additional_dependencies: [black==21.12b0]
|
additional_dependencies: [black==22.8.0]
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
rev: 5.10.1
|
rev: 5.10.1
|
||||||
|
@ -24,7 +24,7 @@ repos:
|
||||||
- id: isort
|
- id: isort
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 4.0.1
|
rev: 5.0.4
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
additional_dependencies: [flake8-2020, flake8-implicit-str-concat]
|
||||||
|
@ -37,15 +37,22 @@ repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.3.0
|
rev: v4.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-merge-conflict
|
|
||||||
- id: check-json
|
- id: check-json
|
||||||
|
- id: check-merge-conflict
|
||||||
|
- id: check-toml
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: requirements-txt-fixer
|
||||||
|
|
||||||
- repo: https://github.com/asottile/setup-cfg-fmt
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
||||||
rev: v1.20.1
|
rev: 0.3.5
|
||||||
hooks:
|
hooks:
|
||||||
- id: setup-cfg-fmt
|
- id: pyproject-fmt
|
||||||
args: [--max-py-version=3.11]
|
|
||||||
|
- repo: https://github.com/abravalheri/validate-pyproject
|
||||||
|
rev: v0.10.1
|
||||||
|
hooks:
|
||||||
|
- id: validate-pyproject
|
||||||
|
|
||||||
- repo: https://github.com/tox-dev/tox-ini-fmt
|
- repo: https://github.com/tox-dev/tox-ini-fmt
|
||||||
rev: 0.5.2
|
rev: 0.5.2
|
||||||
|
|
73
pyproject.toml
Normal file
73
pyproject.toml
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
[build-system]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
requires = [
|
||||||
|
"setuptools>=61.2",
|
||||||
|
"setuptools-scm",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "pylast"
|
||||||
|
description = "A Python interface to Last.fm and Libre.fm"
|
||||||
|
readme = "README.md"
|
||||||
|
keywords = [
|
||||||
|
"Last.fm",
|
||||||
|
"music",
|
||||||
|
"scrobble",
|
||||||
|
"scrobbling",
|
||||||
|
]
|
||||||
|
license = {text = "Apache-2.0"}
|
||||||
|
maintainers = [{name = "Hugo van Kemenade"}]
|
||||||
|
authors = [{name = "Amr Hassan <amr.hassan@gmail.com> and Contributors", email = "amr.hassan@gmail.com"}]
|
||||||
|
requires-python = ">=3.7"
|
||||||
|
dependencies = [
|
||||||
|
"httpx",
|
||||||
|
'importlib-metadata; python_version < "3.8"',
|
||||||
|
]
|
||||||
|
dynamic = [
|
||||||
|
"version",
|
||||||
|
]
|
||||||
|
classifiers = [
|
||||||
|
"Development Status :: 5 - Production/Stable",
|
||||||
|
"License :: OSI Approved :: Apache Software License",
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
|
"Programming Language :: Python :: 3.7",
|
||||||
|
"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",
|
||||||
|
"Topic :: Internet",
|
||||||
|
"Topic :: Multimedia :: Sound/Audio",
|
||||||
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
||||||
|
]
|
||||||
|
[project.optional-dependencies]
|
||||||
|
tests = [
|
||||||
|
"flaky",
|
||||||
|
"pytest",
|
||||||
|
"pytest-cov",
|
||||||
|
"pytest-random-order",
|
||||||
|
"pyyaml",
|
||||||
|
]
|
||||||
|
|
||||||
|
[project.urls]
|
||||||
|
Changelog = "https://github.com/pylast/pylast/releases"
|
||||||
|
Homepage = "https://github.com/pylast/pylast"
|
||||||
|
Source = "https://github.com/pylast/pylast"
|
||||||
|
|
||||||
|
|
||||||
|
[tool.isort]
|
||||||
|
profile = "black"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
package-dir = {"" = "src"}
|
||||||
|
license-files = ["LICENSE.txt"]
|
||||||
|
include-package-data = false
|
||||||
|
|
||||||
|
[tool.setuptools.packages.find]
|
||||||
|
where = ["src"]
|
||||||
|
namespaces = false
|
||||||
|
|
||||||
|
[tool.setuptools_scm]
|
||||||
|
local_scheme = "no-local-version"
|
58
setup.cfg
58
setup.cfg
|
@ -1,58 +0,0 @@
|
||||||
[metadata]
|
|
||||||
name = pylast
|
|
||||||
description = A Python interface to Last.fm and Libre.fm
|
|
||||||
long_description = file: README.md
|
|
||||||
long_description_content_type = text/markdown
|
|
||||||
url = https://github.com/pylast/pylast
|
|
||||||
author = Amr Hassan <amr.hassan@gmail.com> and Contributors
|
|
||||||
author_email = amr.hassan@gmail.com
|
|
||||||
maintainer = Hugo van Kemenade
|
|
||||||
license = Apache-2.0
|
|
||||||
license_file = LICENSE.txt
|
|
||||||
classifiers =
|
|
||||||
Development Status :: 5 - Production/Stable
|
|
||||||
License :: OSI Approved :: Apache Software License
|
|
||||||
Programming Language :: Python :: 3
|
|
||||||
Programming Language :: Python :: 3 :: Only
|
|
||||||
Programming Language :: Python :: 3.7
|
|
||||||
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
|
|
||||||
Topic :: Internet
|
|
||||||
Topic :: Multimedia :: Sound/Audio
|
|
||||||
Topic :: Software Development :: Libraries :: Python Modules
|
|
||||||
keywords =
|
|
||||||
Last.fm
|
|
||||||
music
|
|
||||||
scrobble
|
|
||||||
scrobbling
|
|
||||||
|
|
||||||
[options]
|
|
||||||
packages = find:
|
|
||||||
install_requires =
|
|
||||||
httpx
|
|
||||||
importlib-metadata;python_version < '3.8'
|
|
||||||
python_requires = >=3.7
|
|
||||||
package_dir = =src
|
|
||||||
setup_requires =
|
|
||||||
setuptools-scm
|
|
||||||
|
|
||||||
[options.packages.find]
|
|
||||||
where = src
|
|
||||||
|
|
||||||
[options.extras_require]
|
|
||||||
tests =
|
|
||||||
flaky
|
|
||||||
pytest
|
|
||||||
pytest-cov
|
|
||||||
pytest-random-order
|
|
||||||
pyyaml
|
|
||||||
|
|
||||||
[flake8]
|
|
||||||
max_line_length = 88
|
|
||||||
|
|
||||||
[tool:isort]
|
|
||||||
profile = black
|
|
12
setup.py
12
setup.py
|
@ -1,12 +0,0 @@
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
|
|
||||||
def local_scheme(version: str) -> str:
|
|
||||||
"""Skip the local version (eg. +xyz of 0.6.1.dev4+gdf99fe2)
|
|
||||||
to be able to upload to Test PyPI"""
|
|
||||||
return ""
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
|
||||||
use_scm_version={"local_scheme": local_scheme},
|
|
||||||
)
|
|
Loading…
Reference in a new issue