mirror of
https://github.com/YuzuZensai/spleeter.git
synced 2026-01-06 04:32:43 +00:00
fix: gpu distribution
This commit is contained in:
@@ -49,6 +49,16 @@ jobs:
|
||||
key: sdist-{{ .Branch }}-{{ checksum "setup.py" }}
|
||||
paths:
|
||||
- dist
|
||||
sdist-gpu:
|
||||
docker:
|
||||
- image: python:3
|
||||
steps:
|
||||
- checkout
|
||||
- run: make build-gpu
|
||||
- save_cache:
|
||||
key: sdist-{{ .Branch }}-{{ checksum "setup.py" }}
|
||||
paths:
|
||||
- dist
|
||||
# =======================================================================================
|
||||
# PyPi deployment.
|
||||
# =======================================================================================
|
||||
@@ -64,7 +74,20 @@ jobs:
|
||||
# TODO: Infer destination regarding of branch.
|
||||
# - master => production PyPi
|
||||
# - other => testing PyPi
|
||||
command: make deploy
|
||||
command: make build deploy
|
||||
pypi-deploy-gpu:
|
||||
docker:
|
||||
- image: python:3
|
||||
steps:
|
||||
- checkout
|
||||
- restore_cache:
|
||||
key: sdist-{{ .Branch }}-{{ checksum "setup.py" }}
|
||||
- run:
|
||||
name: upload to PyPi
|
||||
# TODO: Infer destination regarding of branch.
|
||||
# - master => production PyPi
|
||||
# - other => testing PyPi
|
||||
command: make build-gpu deploy
|
||||
# =======================================================================================
|
||||
# Docker build.
|
||||
# =======================================================================================
|
||||
@@ -102,6 +125,8 @@ jobs:
|
||||
- run: docker push researchdeezer/spleeter:conda-gpu-2stems
|
||||
- run: docker push researchdeezer/spleeter:conda-gpu-4stems
|
||||
- run: docker push researchdeezer/spleeter:conda-gpu-5stems
|
||||
- run: docker tag researchdeezer/spleeter:conda-gpu researchdeezer/spleeter:gpu
|
||||
- run: docker push researchdeezer/spleeter:gpu
|
||||
docker-3.6-cpu:
|
||||
docker:
|
||||
- image: docker:17.05.0-ce-git
|
||||
@@ -152,6 +177,10 @@ workflows:
|
||||
requires:
|
||||
- test-3.6
|
||||
- test-3.7
|
||||
- sdist-gpu:
|
||||
requires:
|
||||
- test-3.6
|
||||
- test-3.7
|
||||
- pypi-deploy:
|
||||
filters:
|
||||
branches:
|
||||
@@ -159,10 +188,18 @@ workflows:
|
||||
- master
|
||||
requires:
|
||||
- sdist
|
||||
- pypi-deploy-gpu:
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
requires:
|
||||
- sdist
|
||||
- conda-forge-validation:
|
||||
type: approval
|
||||
requires:
|
||||
- pypi-deploy
|
||||
- pypi-deploy-gpu
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
|
||||
11
Makefile
11
Makefile
@@ -15,7 +15,14 @@ clean:
|
||||
rm -Rf *.egg-info
|
||||
rm -Rf dist
|
||||
|
||||
build:
|
||||
build: clean
|
||||
sed -i "s/project_name = ''/project_name = 'spleeter'/g"
|
||||
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"
|
||||
sed -i "s/tensorflow_dependency = '[^']*'/tensorflow_dependency = 'tensorflow-gpu'/g" setup.py
|
||||
python3 setup.py sdist
|
||||
|
||||
test:
|
||||
@@ -23,4 +30,4 @@ test:
|
||||
|
||||
deploy:
|
||||
pip install twine
|
||||
twine upload --skip-existing dist/*
|
||||
twine upload --skip-existing dist/*
|
||||
|
||||
13
setup.py
13
setup.py
@@ -15,7 +15,6 @@ __license__ = 'MIT License'
|
||||
# Default project values.
|
||||
project_name = 'spleeter'
|
||||
project_version = '1.4.4'
|
||||
device_target = 'cpu'
|
||||
tensorflow_dependency = 'tensorflow'
|
||||
tensorflow_version = '1.14.0'
|
||||
here = path.abspath(path.dirname(__file__))
|
||||
@@ -23,18 +22,6 @@ readme_path = path.join(here, 'README.md')
|
||||
with open(readme_path, 'r') as stream:
|
||||
readme = stream.read()
|
||||
|
||||
# Check if GPU target is specified.
|
||||
if '--target' in sys.argv:
|
||||
target_index = sys.argv.index('--target') + 1
|
||||
target = sys.argv[target_index].lower()
|
||||
sys.argv.remove('--target')
|
||||
sys.argv.pop(target_index)
|
||||
|
||||
# GPU target compatibility check.
|
||||
if device_target == 'gpu':
|
||||
project_name = '{}-gpu'.format(project_name)
|
||||
tensorflow_dependency = 'tensorflow-gpu'
|
||||
|
||||
# Package setup entrypoint.
|
||||
setup(
|
||||
name=project_name,
|
||||
|
||||
Reference in New Issue
Block a user