use pyproject.toml for build
This commit is contained in:
parent
889b29b530
commit
b7a3e7544d
6 changed files with 63 additions and 51 deletions
39
.github/workflows/pythonpublish.yml
vendored
39
.github/workflows/pythonpublish.yml
vendored
|
|
@ -2,25 +2,30 @@ name: Upload Python Package
|
|||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v1
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install setuptools wheel twine
|
||||
- name: Build
|
||||
run: |
|
||||
python setup.py sdist bdist_wheel
|
||||
- name: Publish distribution 📦 to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@master
|
||||
with:
|
||||
password: ${{ secrets.PYPI_PASSWORD }}
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v3
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish package
|
||||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
|
||||
with:
|
||||
user: __token__
|
||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||
|
|
|
|||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -7,4 +7,6 @@ docs/build
|
|||
.coverage
|
||||
**/__pycache__/
|
||||
venv*/
|
||||
*.egg-info/
|
||||
*.egg-info/
|
||||
build
|
||||
dist
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
include README.md
|
||||
recursive-include ytmusicapi/locales *.mo
|
||||
recursive-include ytmusicapi *.py
|
||||
|
|
@ -79,7 +79,7 @@ The `tests <https://github.com/sigma67/ytmusicapi/blob/master/tests/test.py>`_ a
|
|||
Requirements
|
||||
==============
|
||||
|
||||
- Python 3.6 or higher - https://www.python.org
|
||||
- Python 3.7 or higher - https://www.python.org
|
||||
|
||||
Setup and Usage
|
||||
===============
|
||||
|
|
|
|||
37
pyproject.toml
Normal file
37
pyproject.toml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
[project]
|
||||
name = "ytmusicapi"
|
||||
description = "Unofficial API for YouTube Music"
|
||||
requires-python = ">=3.7"
|
||||
authors=[{name = "sigma67", email= "ytmusicapi@gmail.com"}]
|
||||
license={file="LICENSE"}
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
]
|
||||
dependencies = [
|
||||
"requests >= 2.22",
|
||||
]
|
||||
dynamic = ["version", "readme"]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ['pre-commit', 'flake8', 'yapf', 'coverage', 'sphinx', 'sphinx-rtd-theme']
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://github.com/sigma67/ytmusicapi"
|
||||
documentation = "https://ytmusicapi.readthedocs.io"
|
||||
repository = "https://github.com/sigma67/ytmusicapi"
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=65", "setuptools_scm[toml]>=7"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[tool.setuptools_scm]
|
||||
|
||||
[tool.setuptools.dynamic]
|
||||
readme = {file = ["README.rst"]}
|
||||
|
||||
[tool.setuptools]
|
||||
include-package-data=false
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
"*" = ["**.rst", "**.py", "**.mo"]
|
||||
29
setup.py
29
setup.py
|
|
@ -1,29 +0,0 @@
|
|||
from setuptools import setup, find_packages
|
||||
import re
|
||||
|
||||
VERSIONFILE = 'ytmusicapi/_version.py'
|
||||
|
||||
version_line = open(VERSIONFILE).read()
|
||||
version_re = r"^__version__ = ['\"]([^'\"]*)['\"]"
|
||||
match = re.search(version_re, version_line, re.M)
|
||||
if match:
|
||||
version = match.group(1)
|
||||
else:
|
||||
raise RuntimeError("Could not find version in '%s'" % VERSIONFILE)
|
||||
|
||||
setup(name='ytmusicapi',
|
||||
version=version,
|
||||
description='Unofficial API for YouTube Music',
|
||||
long_description=(open('README.rst').read()),
|
||||
url='https://github.com/sigma67/ytmusicapi',
|
||||
author='sigma67',
|
||||
author_email='',
|
||||
license='MIT',
|
||||
packages=find_packages(),
|
||||
install_requires=['requests >= 2.22'],
|
||||
extras_require={
|
||||
'dev': ['pre-commit', 'flake8', 'yapf', 'coverage', 'sphinx', 'sphinx-rtd-theme']
|
||||
},
|
||||
python_requires=">=3.6",
|
||||
include_package_data=True,
|
||||
zip_safe=False)
|
||||
Loading…
Reference in a new issue