Skip to content

Commit

Permalink
updating setup and install workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
csteinmetz1 committed Jan 5, 2023
1 parent c228b77 commit ddc8880
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 18 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish Python distributions to PyPI and TestPyPI

on: push

jobs:
build-n-publish:
name: Publish Python distributions to PyPI and TestPyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution to Test PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
13 changes: 13 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[project]
name = "pyloudnorm"
version = "0.1.1"
description = "Implementation of ITU-R BS.1770-4 loudness algorithm in Python."
authors = [
{ name = "Christian Steinmetz" },
{ email = "[email protected]" },
]

[build-system]
# Minimum requirements for the build system to execute.
requires = ["setuptools>=58.0", "wheel", "attrs"]
build-backend = "setuptools.build_meta"
53 changes: 35 additions & 18 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,41 @@
from setuptools import setup
from pathlib import Path
from setuptools import setup, find_packages

with open("README.md", "r") as fh:
long_description = fh.read()
NAME = "pyloudnorm"
DESCRIPTION = "Implementation of ITU-R BS.1770-4 loudness algorithm in Python"
URL = "https://github.com/csteinmetz1/pyloudnorm"
EMAIL = "[email protected]"
AUTHOR = "Christian Steinmetz"
REQUIRES_PYTHON = ">=3.0"
VERSION = "0.1.1"

setup(name='pyloudnorm',
version='0.1.0',
description='Implementation of ITU-R BS.1770-4 loudness algorithm in Python',
long_description=long_description,
long_description_content_type="text/markdown",
url='https://github.com/csteinmetz1/pyloudnorm',
author='Christian Steinmetz',
author_email='[email protected]',
packages=['pyloudnorm'],
install_requires=['scipy>=1.0.1',
'numpy>=1.14.2',
'future>=0.16.0'],
classifiers=(
HERE = Path(__file__).parent

try:
with open(HERE / "README.md", encoding="utf-8") as f:
long_description = "\n" + f.read()
except FileNotFoundError:
long_description = DESCRIPTION

setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type="text/markdown",
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=["pyloudnorm"],
install_requires=["scipy>=1.0.1", "numpy>=1.14.2", "future>=0.16.0"],
include_package_data=True,
license="MIT",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 2.7",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
)
"Topic :: Multimedia :: Sound/Audio",
"Topic :: Scientific/Engineering",
],
)

0 comments on commit ddc8880

Please sign in to comment.