From 0fdc42c916bad8e2e4103752f78eae437237c135 Mon Sep 17 00:00:00 2001 From: 34j <55338215+34j@users.noreply.github.com> Date: Wed, 15 Mar 2023 23:15:49 +0900 Subject: [PATCH] chore: initial commit --- .all-contributorsrc | 15 +++ .copier-answers.yml | 22 +++ .editorconfig | 21 +++ .flake8 | 3 + .github/FUNDING.yml | 1 + .github/ISSUE_TEMPLATE/1-bug_report.md | 14 ++ .github/ISSUE_TEMPLATE/2-feature-request.md | 14 ++ .github/labels.toml | 94 +++++++++++++ .github/workflows/ci.yml | 90 +++++++++++++ .github/workflows/hacktoberfest.yml | 17 +++ .github/workflows/issue-manager.yml | 32 +++++ .github/workflows/labels.yml | 22 +++ .gitignore | 140 ++++++++++++++++++++ .gitpod.yml | 8 ++ .idea/so-vits-svc-fork.iml | 9 ++ .idea/watcherTasks.xml | 65 +++++++++ .idea/workspace.xml | 32 +++++ .pre-commit-config.yaml | 73 ++++++++++ .readthedocs.yml | 24 ++++ CHANGELOG.md | 3 + CONTRIBUTING.md | 117 ++++++++++++++++ LICENSE | 22 +++ README.md | 54 ++++++++ commitlint.config.js | 8 ++ docs/Makefile | 20 +++ docs/_static/.gitkeep | 0 docs/changelog.md | 3 + docs/conf.py | 78 +++++++++++ docs/contributing.md | 3 + docs/index.md | 28 ++++ docs/installation.md | 7 + docs/make.bat | 35 +++++ docs/usage.md | 9 ++ pyproject.toml | 92 +++++++++++++ renovate.json | 3 + setup.py | 9 ++ src/so_vits_svc_fork/__init__.py | 1 + src/so_vits_svc_fork/main.py | 2 + src/so_vits_svc_fork/py.typed | 0 tests/__init__.py | 0 tests/test_main.py | 5 + 41 files changed, 1195 insertions(+) create mode 100644 .all-contributorsrc create mode 100644 .copier-answers.yml create mode 100644 .editorconfig create mode 100644 .flake8 create mode 100644 .github/FUNDING.yml create mode 100644 .github/ISSUE_TEMPLATE/1-bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/2-feature-request.md create mode 100644 .github/labels.toml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/hacktoberfest.yml create mode 100644 .github/workflows/issue-manager.yml create mode 100644 .github/workflows/labels.yml create mode 100644 .gitignore create mode 100644 .gitpod.yml create mode 100644 .idea/so-vits-svc-fork.iml create mode 100644 .idea/watcherTasks.xml create mode 100644 .idea/workspace.xml create mode 100644 .pre-commit-config.yaml create mode 100644 .readthedocs.yml create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 commitlint.config.js create mode 100644 docs/Makefile create mode 100644 docs/_static/.gitkeep create mode 100644 docs/changelog.md create mode 100644 docs/conf.py create mode 100644 docs/contributing.md create mode 100644 docs/index.md create mode 100644 docs/installation.md create mode 100644 docs/make.bat create mode 100644 docs/usage.md create mode 100644 pyproject.toml create mode 100644 renovate.json create mode 100644 setup.py create mode 100644 src/so_vits_svc_fork/__init__.py create mode 100644 src/so_vits_svc_fork/main.py create mode 100644 src/so_vits_svc_fork/py.typed create mode 100644 tests/__init__.py create mode 100644 tests/test_main.py diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000..8d66e392 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,15 @@ +{ + "projectName": "so-vits-svc-fork", + "projectOwner": "34j", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 80, + "commit": true, + "commitConvention": "angular", + "contributors": [], + "contributorsPerLine": 7, + "skipCi": true +} diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 00000000..941491bc --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,22 @@ +# Changes here will be overwritten by Copier +_commit: 2b33a13 +_src_path: gh:34j/pypackage-template-fork +add_me_as_contributor: true +copyright_year: '2023' +documentation: true +email: 34j.95a2p@simplelogin.com +full_name: 34j +github_username: 34j +initial_commit: true +open_source_license: MIT +open_with_vscode: true +package_name: so_vits_svc_fork +project_name: SoftVC VITS Singing Voice Conversion Fork +project_short_description: A fork of so-vits-svc. +project_slug: so-vits-svc-fork +run_poetry_install: true +setup_github: true +setup_pre_commit: true +setup_venv: true +venv_version: '3.10' + diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..d4a2c440 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# http://editorconfig.org + +root = true + +[*] +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true +insert_final_newline = true +charset = utf-8 +end_of_line = lf + +[*.bat] +indent_style = tab +end_of_line = crlf + +[LICENSE] +insert_final_newline = false + +[Makefile] +indent_style = tab diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..997e99b7 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +exclude = docs +max-line-length = 88 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..803ebaaf --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: ["34j"] diff --git a/.github/ISSUE_TEMPLATE/1-bug_report.md b/.github/ISSUE_TEMPLATE/1-bug_report.md new file mode 100644 index 00000000..4644945a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/1-bug_report.md @@ -0,0 +1,14 @@ +--- +name: Bug report +about: Create a report to help us improve +labels: bug +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/2-feature-request.md b/.github/ISSUE_TEMPLATE/2-feature-request.md new file mode 100644 index 00000000..a4c01ccb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/2-feature-request.md @@ -0,0 +1,14 @@ +--- +name: Feature request +about: Suggest an idea for this project +labels: enhancement +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/labels.toml b/.github/labels.toml new file mode 100644 index 00000000..56865bef --- /dev/null +++ b/.github/labels.toml @@ -0,0 +1,94 @@ +[breaking] +color = "ffcc00" +name = "breaking" +description = "Breaking change." + +[bug] +color = "d73a4a" +name = "bug" +description = "Something isn't working" + +[dependencies] +color = "0366d6" +name = "dependencies" +description = "Pull requests that update a dependency file" + +[github_actions] +color = "000000" +name = "github_actions" +description = "Update of github actions" + +[documentation] +color = "1bc4a5" +name = "documentation" +description = "Improvements or additions to documentation" + +[duplicate] +color = "cfd3d7" +name = "duplicate" +description = "This issue or pull request already exists" + +[enhancement] +color = "a2eeef" +name = "enhancement" +description = "New feature or request" + +["good first issue"] +color = "7057ff" +name = "good first issue" +description = "Good for newcomers" + +["help wanted"] +color = "008672" +name = "help wanted" +description = "Extra attention is needed" + +[invalid] +color = "e4e669" +name = "invalid" +description = "This doesn't seem right" + +[nochangelog] +color = "555555" +name = "nochangelog" +description = "Exclude pull requests from changelog" + +[question] +color = "d876e3" +name = "question" +description = "Further information is requested" + +[removed] +color = "e99695" +name = "removed" +description = "Removed piece of functionalities." + +[tests] +color = "bfd4f2" +name = "tests" +description = "CI, CD and testing related changes" + +[wontfix] +color = "ffffff" +name = "wontfix" +description = "This will not be worked on" + +[discussion] +color = "c2e0c6" +name = "discussion" +description = "Some discussion around the project" + +[hacktoberfest] +color = "ffa663" +name = "hacktoberfest" +description = "Good issues for Hacktoberfest" + +[answered] +color = "0ee2b6" +name = "answered" +description = "Automatically closes as answered after a delay" + +[waiting] +color = "5f7972" +name = "waiting" +description = "Automatically closes if no answer after a delay" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..3807f7b2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,90 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.9" + - uses: pre-commit/action@v3.0.0 + + # Make sure commit messages follow the conventional commits convention: + # https://www.conventionalcommits.org + commitlint: + name: Lint Commit Messages + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: wagoid/commitlint-github-action@v5.3.1 + + test: + strategy: + fail-fast: false + matrix: + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + os: + - ubuntu-latest + # - windows-latest + # - macOS-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - uses: snok/install-poetry@v1.3.3 + - name: Install Dependencies + run: poetry install + shell: bash + - name: Test with Pytest + run: poetry run pytest --cov-report=xml + shell: bash + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + + release: + runs-on: ubuntu-latest + environment: release + if: github.ref == 'refs/heads/main' + needs: + - test + - lint + - commitlint + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # Run semantic release: + # - Update CHANGELOG.md + # - Update version in code + # - Create git tag + # - Create GitHub release + # - Publish to PyPI + - name: Python Semantic Release + uses: relekang/python-semantic-release@v7.33.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/hacktoberfest.yml b/.github/workflows/hacktoberfest.yml new file mode 100644 index 00000000..00239a4a --- /dev/null +++ b/.github/workflows/hacktoberfest.yml @@ -0,0 +1,17 @@ +name: Hacktoberfest + +on: + schedule: + # Run every day in October + - cron: "0 0 * 10 *" + # Run on the 1st of November to revert + - cron: "0 13 1 11 *" + +jobs: + hacktoberfest: + runs-on: ubuntu-latest + + steps: + - uses: browniebroke/hacktoberfest-labeler-action@v2.3.0 + with: + github_token: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml new file mode 100644 index 00000000..e41c2fbd --- /dev/null +++ b/.github/workflows/issue-manager.yml @@ -0,0 +1,32 @@ +name: Issue Manager + +on: + schedule: + - cron: "0 0 * * *" + issue_comment: + types: + - created + issues: + types: + - labeled + pull_request_target: + types: + - labeled + workflow_dispatch: + +jobs: + issue-manager: + runs-on: ubuntu-latest + steps: + - uses: tiangolo/issue-manager@0.4.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + config: > + { + "answered": { + "message": "Assuming the original issue was solved, it will be automatically closed now." + }, + "waiting": { + "message": "Automatically closing. To re-open, please provide the additional information requested." + } + } diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml new file mode 100644 index 00000000..c9330a48 --- /dev/null +++ b/.github/workflows/labels.yml @@ -0,0 +1,22 @@ +name: Sync Github labels + +on: + push: + branches: + - main + paths: + - ".github/**" + +jobs: + labels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Install labels + run: pip install labels + - name: Sync config with Github + run: labels -u ${{ github.repository_owner }} -t ${{ secrets.GITHUB_TOKEN }} sync -f .github/labels.toml diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..08cfdfd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,140 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder {{package_name}} settings +.spyderproject +.spyproject + +# Rope {{package_name}} settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..450add9c --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,8 @@ +tasks: + - command: | + pip install poetry + PIP_USER=false poetry install + - command: | + pip install pre-commit + pre-commit install + PIP_USER=false pre-commit install-hooks diff --git a/.idea/so-vits-svc-fork.iml b/.idea/so-vits-svc-fork.iml new file mode 100644 index 00000000..a46d9bbd --- /dev/null +++ b/.idea/so-vits-svc-fork.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/.idea/watcherTasks.xml b/.idea/watcherTasks.xml new file mode 100644 index 00000000..08066ab6 --- /dev/null +++ b/.idea/watcherTasks.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 00000000..f2e6d220 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,32 @@ + + + + + + + + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..f4a67c1c --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,73 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: "CHANGELOG.md|.copier-answers.yml" +default_stages: [commit] + +ci: + autofix_commit_msg: "chore(pre-commit.ci): auto fixes" + autoupdate_commit_msg: "chore(pre-commit.ci): pre-commit autoupdate" + +repos: + - repo: https://github.com/commitizen-tools/commitizen + rev: v2.42.0 + hooks: + - id: commitizen + stages: [commit-msg] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: debug-statements + - id: check-builtin-literals + - id: check-case-conflict + - id: check-docstring-first + - id: check-json + - id: check-toml + - id: check-xml + - id: check-yaml + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/python-poetry/poetry + rev: 1.3.2 + hooks: + - id: poetry-check + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.7.1 + hooks: + - id: prettier + args: ["--tab-width", "2"] + - repo: https://github.com/asottile/pyupgrade + rev: v3.3.1 + hooks: + - id: pyupgrade + args: [--py38-plus] + - repo: https://github.com/PyCQA/autoflake + rev: v2.0.1 + hooks: + - id: autoflake + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + - repo: https://github.com/psf/black + rev: 23.1.0 + hooks: + - id: black + - repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell + - repo: https://github.com/PyCQA/flake8 + rev: 6.0.0 + hooks: + - id: flake8 + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v0.931 + hooks: + - id: mypy + additional_dependencies: [] + - repo: https://github.com/PyCQA/bandit + rev: 1.7.4 + hooks: + - id: bandit + args: [-x, tests] diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 00000000..53891ad5 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,24 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: "3.9" + jobs: + post_create_environment: + # Install poetry + - pip install poetry + # Tell poetry to not use a virtual environment + - poetry config virtualenvs.create false + post_install: + # Install dependencies + - poetry install --with docs + +# Build documentation in the docs directory with Sphinx +sphinx: + configuration: docs/conf.py diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..d29d5af1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..c91cc57b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,117 @@ +# Contributing + +Contributions are welcome, and they are greatly appreciated! Every little helps, and credit will always be given. + +You can contribute in many ways: + +## Types of Contributions + +### Report Bugs + +Report bugs to [our issue page][gh-issues]. If you are reporting a bug, please include: + +- Your operating system name and version. +- Any details about your local setup that might be helpful in troubleshooting. +- Detailed steps to reproduce the bug. + +### Fix Bugs + +Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it. + +### Implement Features + +Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it. + +### Write Documentation + +SoftVC VITS Singing Voice Conversion Fork could always use more documentation, whether as part of the official SoftVC VITS Singing Voice Conversion Fork docs, in docstrings, or even on the web in blog posts, articles, and such. + +### Submit Feedback + +The best way to send feedback [our issue page][gh-issues] on GitHub. If you are proposing a feature: + +- Explain in detail how it would work. +- Keep the scope as narrow as possible, to make it easier to implement. +- Remember that this is a volunteer-driven project, and that contributions are welcome 😊 + +## Get Started! + +Ready to contribute? Here's how to set yourself up for local development. + +1. Fork the repo on GitHub. + +2. Clone your fork locally: + + ```shell + $ git clone git@github.com:your_name_here/so-vits-svc-fork.git + ``` + +3. Install the project dependencies with [Poetry](https://python-poetry.org): + + ```shell + $ poetry install + ``` + +4. Create a branch for local development: + + ```shell + $ git checkout -b name-of-your-bugfix-or-feature + ``` + + Now you can make your changes locally. + +5. When you're done making changes, check that your changes pass our tests: + + ```shell + $ poetry run pytest + ``` + +6. Linting is done through [pre-commit](https://pre-commit.com). Provided you have the tool installed globally, you can run them all as one-off: + + ```shell + $ pre-commit run -a + ``` + + Or better, install the hooks once and have them run automatically each time you commit: + + ```shell + $ pre-commit install + ``` + +7. Commit your changes and push your branch to GitHub: + + ```shell + $ git add . + $ git commit -m "feat(something): your detailed description of your changes" + $ git push origin name-of-your-bugfix-or-feature + ``` + + Note: the commit message should follow [the conventional commits](https://www.conventionalcommits.org). We run [`commitlint` on CI](https://github.com/marketplace/actions/commit-linter) to validate it, and if you've installed pre-commit hooks at the previous step, the message will be checked at commit time. + +8. Submit a pull request through the GitHub website or using the GitHub CLI (if you have it installed): + + ```shell + $ gh pr create --fill + ``` + +## Pull Request Guidelines + +We like to have the pull request open as soon as possible, that's a great place to discuss any piece of work, even unfinished. You can use draft pull request if it's still a work in progress. Here are a few guidelines to follow: + +1. Include tests for feature or bug fixes. +2. Update the documentation for significant features. +3. Ensure tests are passing on CI. + +## Tips + +To run a subset of tests: + +```shell +$ pytest tests +``` + +## Making a new release + +The deployment should be automated and can be triggered from the Semantic Release workflow in GitHub. The next version will be based on [the commit logs](https://python-semantic-release.readthedocs.io/en/latest/commit-log-parsing.html#commit-log-parsing). This is done by [python-semantic-release](https://python-semantic-release.readthedocs.io/en/latest/index.html) via a GitHub action. + +[gh-issues]: https://github.com/34j/so-vits-svc-fork/issues diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a24e1f08 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ + +MIT License + +Copyright (c) 2023 34j and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..46a88c9f --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# SoftVC VITS Singing Voice Conversion Fork + +

+ + CI Status + + + Documentation Status + + + Test coverage percentage + +

+

+ + Poetry + + + black + + + pre-commit + +

+

+ + PyPI Version + + Supported Python versions + License +

+ +A fork of so-vits-svc. + +## Installation + +Install this via pip (or your favourite package manager): + +```shell +pip install so-vits-svc-fork +``` + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..8b827688 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,8 @@ +module.exports = { + extends: ["@commitlint/config-conventional"], + rules: { + "header-max-length": [0, "always", Infinity], + "body-max-line-length": [0, "always", Infinity], + "footer-max-line-length": [0, "always", Infinity], + }, +}; diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 00000000..d4bb2cbb --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/_static/.gitkeep b/docs/_static/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 00000000..d9e79ba6 --- /dev/null +++ b/docs/changelog.md @@ -0,0 +1,3 @@ +```{include} ../CHANGELOG.md + +``` diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 00000000..97d057fc --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,78 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html +from pathlib import Path +from typing import Any + +from sphinx.application import Sphinx +from sphinx.ext import apidoc + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "SoftVC VITS Singing Voice Conversion Fork" +copyright = "2023, 34j" +author = "34j" +release = "0.0.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "myst_parser", + "sphinx.ext.napoleon", + "sphinx.ext.autodoc", + "sphinx.ext.viewcode", +] +napoleon_google_docstring = False + +# The suffix of source filenames. +source_suffix = [".rst", ".md"] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns: list[str] = [] + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + + +# -- Automatically run sphinx-apidoc ----------------------------------------- + + +def run_apidoc(_: Any) -> None: + docs_path = Path(__file__).parent + module_path = docs_path.parent / "src" / "so_vits_svc_fork" + + apidoc.main( + [ + "--force", + "--module-first", + "-o", + docs_path.as_posix(), + module_path.as_posix(), + ] + ) + + +def setup(app: Sphinx) -> None: + app.connect("builder-inited", run_apidoc) diff --git a/docs/contributing.md b/docs/contributing.md new file mode 100644 index 00000000..66c1f98d --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1,3 @@ +```{include} ../CONTRIBUTING.md + +``` diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 00000000..610cebce --- /dev/null +++ b/docs/index.md @@ -0,0 +1,28 @@ +# Welcome to SoftVC VITS Singing Voice Conversion Fork documentation! + +```{toctree} +:caption: Installation & Usage +:maxdepth: 2 + +installation +usage +``` + +```{toctree} +:caption: Project Info +:maxdepth: 2 + +changelog +contributing +``` + +```{toctree} +:caption: API Reference +:maxdepth: 2 + +so_vits_svc_fork +``` + +```{include} ../README.md + +``` diff --git a/docs/installation.md b/docs/installation.md new file mode 100644 index 00000000..512a87f6 --- /dev/null +++ b/docs/installation.md @@ -0,0 +1,7 @@ +# Installation + +The package is published on [PyPI](https://pypi.org/project/so-vits-svc-fork/) and can be installed with `pip` (or any equivalent): + +```bash +pip install so-vits-svc-fork +``` diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 00000000..954237b9 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 00000000..0caf8915 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,9 @@ +# Usage + +To use this package, import it: + +```python +import so_vits_svc_fork +``` + +TODO: Document usage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..34f92da0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,92 @@ +[tool.poetry] +name = "so-vits-svc-fork" +version = "0.0.0" +description = "A fork of so-vits-svc." +authors = ["34j <34j.95a2p@simplelogin.com>"] +license = "MIT" +readme = "README.md" +repository = "https://github.com/34j/so-vits-svc-fork" +documentation = "https://so-vits-svc-fork.readthedocs.io" +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: OS Independent", + "Topic :: Software Development :: Libraries", +] +packages = [ + { include = "so_vits_svc_fork", from = "src" }, +] + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/34j/so-vits-svc-fork/issues" +"Changelog" = "https://github.com/34j/so-vits-svc-fork/blob/main/CHANGELOG.md" + +[tool.poetry.dependencies] +python = "^3.8" + +[tool.poetry.group.dev.dependencies] +pre-commit = ">=3" +pytest = "^7.0" +pytest-cov = "^3.0" + +[tool.poetry.group.docs] +optional = true + +[tool.poetry.group.docs.dependencies] +myst-parser = ">=0.16" +sphinx = ">=4.0" +sphinx-rtd-theme = ">=1.0" + +[tool.semantic_release] +branch = "main" +version_toml = "pyproject.toml:tool.poetry.version" +version_variable = "src/so_vits_svc_fork/__init__.py:__version__" +build_command = "pip install poetry && poetry build" + +[tool.pytest.ini_options] +addopts = "-v -Wdefault --cov=so_vits_svc_fork --cov-report=term-missing:skip-covered" +pythonpath = ["src"] + +[tool.coverage.run] +branch = true + +[tool.coverage.report] +exclude_lines = [ + "pragma: no cover", + "@overload", + "if TYPE_CHECKING", + "raise NotImplementedError", + 'if __name__ == "__main__":', +] + +[tool.isort] +profile = "black" +known_first_party = ["so_vits_svc_fork", "tests"] + +[tool.mypy] +check_untyped_defs = true +disallow_any_generics = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +mypy_path = "src/" +no_implicit_optional = true +show_error_codes = true +warn_unreachable = true +warn_unused_ignores = true +exclude = [ + 'docs/.*', + 'setup.py', +] + +[[tool.mypy.overrides]] +module = "tests.*" +allow_untyped_defs = true + +[[tool.mypy.overrides]] +module = "docs.*" +ignore_errors = true + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..0200e15c --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "extends": ["github>browniebroke/renovate-configs:python"] +} diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..aa05c826 --- /dev/null +++ b/setup.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python + +# This is a shim to allow GitHub to detect the package, build is done with poetry +# Taken from https://github.com/Textualize/rich + +import setuptools + +if __name__ == "__main__": + setuptools.setup(name="so-vits-svc-fork") diff --git a/src/so_vits_svc_fork/__init__.py b/src/so_vits_svc_fork/__init__.py new file mode 100644 index 00000000..6c8e6b97 --- /dev/null +++ b/src/so_vits_svc_fork/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.0" diff --git a/src/so_vits_svc_fork/main.py b/src/so_vits_svc_fork/main.py new file mode 100644 index 00000000..f2a43485 --- /dev/null +++ b/src/so_vits_svc_fork/main.py @@ -0,0 +1,2 @@ +def add(n1: int, n2: int) -> int: + return n1 + n2 diff --git a/src/so_vits_svc_fork/py.typed b/src/so_vits_svc_fork/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/test_main.py b/tests/test_main.py new file mode 100644 index 00000000..3d509bf5 --- /dev/null +++ b/tests/test_main.py @@ -0,0 +1,5 @@ +from so_vits_svc_fork.main import add + + +def test_add(): + assert add(1, 1) == 2