Skip to content

Commit ddc8880

Browse files
committed
updating setup and install workflow
1 parent c228b77 commit ddc8880

File tree

3 files changed

+87
-18
lines changed

3 files changed

+87
-18
lines changed
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish Python distributions to PyPI and TestPyPI
2+
3+
on: push
4+
5+
jobs:
6+
build-n-publish:
7+
name: Publish Python distributions to PyPI and TestPyPI
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Set up Python 3.7
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.7
15+
- name: Install pypa/build
16+
run: >-
17+
python -m
18+
pip install
19+
build
20+
--user
21+
- name: Build a binary wheel and a source tarball
22+
run: >-
23+
python -m
24+
build
25+
--sdist
26+
--wheel
27+
--outdir dist/
28+
.
29+
- name: Publish distribution to Test PyPI
30+
if: startsWith(github.ref, 'refs/tags')
31+
uses: pypa/gh-action-pypi-publish@master
32+
with:
33+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
34+
repository_url: https://test.pypi.org/legacy/
35+
- name: Publish distribution to PyPI
36+
if: startsWith(github.ref, 'refs/tags')
37+
uses: pypa/gh-action-pypi-publish@master
38+
with:
39+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[project]
2+
name = "pyloudnorm"
3+
version = "0.1.1"
4+
description = "Implementation of ITU-R BS.1770-4 loudness algorithm in Python."
5+
authors = [
6+
{ name = "Christian Steinmetz" },
7+
{ email = "[email protected]" },
8+
]
9+
10+
[build-system]
11+
# Minimum requirements for the build system to execute.
12+
requires = ["setuptools>=58.0", "wheel", "attrs"]
13+
build-backend = "setuptools.build_meta"

setup.py

+35-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
1-
from setuptools import setup
1+
from pathlib import Path
2+
from setuptools import setup, find_packages
23

3-
with open("README.md", "r") as fh:
4-
long_description = fh.read()
4+
NAME = "pyloudnorm"
5+
DESCRIPTION = "Implementation of ITU-R BS.1770-4 loudness algorithm in Python"
6+
URL = "https://github.com/csteinmetz1/pyloudnorm"
7+
8+
AUTHOR = "Christian Steinmetz"
9+
REQUIRES_PYTHON = ">=3.0"
10+
VERSION = "0.1.1"
511

6-
setup(name='pyloudnorm',
7-
version='0.1.0',
8-
description='Implementation of ITU-R BS.1770-4 loudness algorithm in Python',
9-
long_description=long_description,
10-
long_description_content_type="text/markdown",
11-
url='https://github.com/csteinmetz1/pyloudnorm',
12-
author='Christian Steinmetz',
13-
author_email='[email protected]',
14-
packages=['pyloudnorm'],
15-
install_requires=['scipy>=1.0.1',
16-
'numpy>=1.14.2',
17-
'future>=0.16.0'],
18-
classifiers=(
12+
HERE = Path(__file__).parent
13+
14+
try:
15+
with open(HERE / "README.md", encoding="utf-8") as f:
16+
long_description = "\n" + f.read()
17+
except FileNotFoundError:
18+
long_description = DESCRIPTION
19+
20+
setup(
21+
name=NAME,
22+
version=VERSION,
23+
description=DESCRIPTION,
24+
long_description=long_description,
25+
long_description_content_type="text/markdown",
26+
author=AUTHOR,
27+
author_email=EMAIL,
28+
python_requires=REQUIRES_PYTHON,
29+
url=URL,
30+
packages=["pyloudnorm"],
31+
install_requires=["scipy>=1.0.1", "numpy>=1.14.2", "future>=0.16.0"],
32+
include_package_data=True,
33+
license="MIT",
34+
classifiers=[
1935
"Programming Language :: Python :: 3",
20-
"Programming Language :: Python :: 2.7",
2136
"License :: OSI Approved :: MIT License",
2237
"Operating System :: OS Independent",
23-
)
38+
"Topic :: Multimedia :: Sound/Audio",
39+
"Topic :: Scientific/Engineering",
40+
],
2441
)

0 commit comments

Comments
 (0)