From 0a541f93d10c3b2fae073dde57d568efaf3bb2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Voituret?= Date: Fri, 8 Jan 2021 18:17:11 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20=202.1.0=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pypi.yml | 38 ++++---------- CHANGELOG.md | 21 ++++++++ MANIFEST.in | 3 -- Makefile | 34 ------------ pyproject.toml | 2 +- setup.py | 103 ------------------------------------- 6 files changed, 32 insertions(+), 169 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 Makefile delete mode 100644 setup.py diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index e2cd0b2..d87f573 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -4,40 +4,22 @@ on: branches: - master env: - TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} - TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} jobs: package-and-deploy: - strategy: - matrix: - platform: [cpu, gpu] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: 3.7 - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - uses: actions/cache@v2 - with: - path: ${{ env.GITHUB_WORKSPACE }}/dist - key: sdist-${{ matrix.platform }}-${{ hashFiles('**/setup.py') }} - restore-keys: | - sdist-${{ matrix.platform }}-${{ hashFiles('**/setup.py') }} - sdist-${{ matrix.platform }} - sdist- - - name: Install dependencies - run: pip install --upgrade pip setuptools twine - - if: ${{ matrix.platform == 'cpu' }} - name: Package CPU distribution - run: make build - - if: ${{ matrix.platform == 'gpu' }} - name: Package GPU distribution) - run: make build-gpu + - name: Install Poetry + run: | + pip install poetry + poetry config virtualenvs.in-project false + poetry config virtualenvs.path ~/.virtualenvs + poetry config pypi-token.pypi $PYPI_TOKEN - name: Deploy to pypi - run: make deploy \ No newline at end of file + run: | + poetry build + poetry publish \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ee851ca..14eb688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,26 @@ # Changelog History +## 2.1.0 + +This version introduce design related changes, especially transition to Typer for CLI managment and Poetry as +library build backend. + +* `-i` option is now deprecated and replaced by traditional CLI input argument listing +* Project is now built using Poetry +* Project requires code formatting using Black and iSort + +### API changes: + +* function `get_default_audio_adapter` is now available as `default()` class method within `AudioAdapter` class +* function `get_default_model_provider` is now available as `default()` class method within `ModelProvider` class +* `STFTBackend` and `Codec` are now string enum +* `GithubModelProvider` now use `httpx` with HTTP/2 support +* Commands are now located in `__main__` module, wrapped as simple function using Typer options module provide specification for each available option and argument +* `types` module provide custom type specification and must be enhanced in future release to provide more robust typing support with MyPy +* `utils.logging` module has been cleaned, logger instance is now a module singleton, and a single function is used to configure it with verbose parameter +* Added a custom logger handler (see tiangolo/typer#203 discussion) + + ## 2.0 First release, October 9th 2020 diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 900e35d..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,3 +0,0 @@ -include spleeter/resources/*.json -include README.md -include LICENSE \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index d667361..0000000 --- a/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -# ======================================================= -# Library lifecycle management. -# -# @author Deezer Research -# @licence MIT Licence -# ======================================================= - -FEEDSTOCK = spleeter-feedstock -FEEDSTOCK_REPOSITORY = https://github.com/deezer/$(FEEDSTOCK) -FEEDSTOCK_RECIPE = $(FEEDSTOCK)/recipe/spleeter/meta.yaml -PYTEST_CMD = pytest -W ignore::FutureWarning -W ignore::DeprecationWarning -vv --forked - -all: clean build test deploy - -clean: - rm -Rf *.egg-info - rm -Rf dist - -build: clean - sed -i "s/project_name = '[^']*'/project_name = 'spleeter'/g" setup.py - sed -i "s/tensorflow_dependency = '[^']*'/tensorflow_dependency = 'tensorflow'/g" setup.py - python3 setup.py sdist - -build-gpu: clean - sed -i "s/project_name = '[^']*'/project_name = 'spleeter-gpu'/g" setup.py - sed -i "s/tensorflow_dependency = '[^']*'/tensorflow_dependency = 'tensorflow-gpu'/g" setup.py - python3 setup.py sdist - -test: - $(PYTEST_CMD) tests/ - -deploy: - pip install twine - twine upload --skip-existing dist/* diff --git a/pyproject.toml b/pyproject.toml index e97d9dc..1ba4db8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ classifiers = [ "Topic :: Utilities" ] packages = [ { include = "spleeter" } ] -include = ["spleeter/resources/*.json"] +include = ["LICENSE", "spleeter/resources/*.json"] [tool.poetry.dependencies] python = "^3.7" diff --git a/setup.py b/setup.py deleted file mode 100644 index 5228b83..0000000 --- a/setup.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -# coding: utf8 - -""" Distribution script. """ - -import sys - -from os import path -from setuptools import setup - -__email__ = 'spleeter@deezer.com' -__author__ = 'Deezer Research' -__license__ = 'MIT License' - -# Default project values. -project_name = 'spleeter' -project_version = '2.1.0' -tensorflow_dependency = 'tensorflow' -tensorflow_version = '2.3.0' -here = path.abspath(path.dirname(__file__)) -readme_path = path.join(here, 'README.md') -with open(readme_path, 'r') as stream: - readme = stream.read() - -# Package setup entrypoint. -setup( - name=project_name, - version=project_version, - description=''' - The Deezer source separation library with - pretrained models based on tensorflow. - ''', - long_description=readme, - long_description_content_type='text/markdown', - author='Deezer Research', - author_email='spleeter@deezer.com', - url='https://github.com/deezer/spleeter', - license='MIT License', - packages=[ - 'spleeter', - 'spleeter.audio', - 'spleeter.model', - 'spleeter.model.functions', - 'spleeter.model.provider', - 'spleeter.resources', - 'spleeter.utils', - ], - package_data={'spleeter.resources': ['*.json']}, - python_requires='>=3.6, <3.9', - include_package_data=True, - install_requires=[ - 'ffmpeg-python==0.2.0', - 'importlib_resources ; python_version<"3.7"', - 'norbert==0.2.1', - 'numpy<1.19.0,>=1.16.0', - 'pandas==1.1.2', - 'httpx[http2]', - 'typer', - 'scipy==1.4.1', - 'setuptools>=41.0.0', - 'librosa==0.8.0', - 'idna<3,>=2.5', - '{}=={}'.format(tensorflow_dependency, tensorflow_version), - ], - extras_require={ - 'evaluation': ['musdb==0.3.1', 'museval==0.3.0'] - }, - entry_points={ - 'console_scripts': ['spleeter=spleeter.__main__:entrypoint'] - }, - classifiers=[ - 'Environment :: Console', - 'Environment :: MacOS X', - 'Intended Audience :: Developers', - 'Intended Audience :: Information Technology', - 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', - 'Natural Language :: English', - 'Operating System :: MacOS', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: POSIX :: Linux', - 'Operating System :: Unix', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3 :: Only', - 'Programming Language :: Python :: Implementation :: CPython', - 'Topic :: Artistic Software', - 'Topic :: Multimedia', - 'Topic :: Multimedia :: Sound/Audio', - 'Topic :: Multimedia :: Sound/Audio :: Analysis', - 'Topic :: Multimedia :: Sound/Audio :: Conversion', - 'Topic :: Multimedia :: Sound/Audio :: Sound Synthesis', - 'Topic :: Scientific/Engineering', - 'Topic :: Scientific/Engineering :: Artificial Intelligence', - 'Topic :: Scientific/Engineering :: Information Analysis', - 'Topic :: Software Development', - 'Topic :: Software Development :: Libraries', - 'Topic :: Software Development :: Libraries :: Python Modules', - 'Topic :: Utilities'] -)