diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad8cca23e20ed68ef27d22f3f57b9c4808c92bcc..c06ab427972920ab0b8c3c31ee226651d94d893e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ stages: - test - build + - publish variables: PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" @@ -61,3 +62,36 @@ build-windows: tags: - docker-build + +build-pypi: + stage: build + image: python:3 + before_script: + - apt-get update + - pip install .[build-pypi] + script: + - python3 setup.py sdist bdist_wheel + tags: + - docker + artifacts: + paths: + - dist/* + expire_in: 1 week + only: + - tags@funkwhale/cli + + +publish: + stage: publish + image: python:3 + before_script: + - apt-get update + - pip install .[publish] + script: + - twine upload dist/* + tags: + - docker + dependencies: + - build-pypi + only: + - tags@funkwhale/cli diff --git a/CHANGELOG b/CHANGELOG new file mode 100644 index 0000000000000000000000000000000000000000..fcb859cd34758df840d68a4dfbd68fb629ed0407 --- /dev/null +++ b/CHANGELOG @@ -0,0 +1,4 @@ +Changelog +========= + +.. towncrier diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..0aa5a2e788856957b0e02fc06246b8ab17bf36a0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,97 @@ +# Contributing to the Funkwhale-Cli project + +This guide needs to be expanded and is currently only documenting things for the changelog-generation. + +## Typical workflow for a contribution + +0. Fork the project if you did not already or if you do not have access to the main repository +1. Checkout the master branch and pull most recent changes: git checkout master && git pull +2. If working on an issue, assign yourself to the issue. Otherwise, consider open an issue before starting to work on something, especially for new features. +3. Create a dedicated branch for your work 42-awesome-fix. It is good practice to prefix your branch name with the ID of the issue you are solving. +4. Work on your stuff +5. Commit small, atomic changes to make it easier to review your contribution +6. Add a changelog fragment to summarize your changes: echo "Implemented awesome stuff (#42)" > changes/changelog.d/42.feature +7. Push your branch +8. Create your merge request +9. Take a step back and enjoy, we're really grateful you did all of this and took the time to contribute! + +## Changelog management + + +To ensure we have extensive and well-structured changelog, any significant work such as closing an issue must include a changelog fragment. Small changes may include a changelog fragment as well but this is not mandatory. If you're not sure about what to do, do not panic, open your merge request normally and we'll figure everything during the review ;) + +Changelog fragments are text files that can contain one or multiple lines that describe the changes occurring in a bunch of commits. Those files reside in `changes/changelog.d`. + +### Content + +A typical fragment looks like that: + +> Fixed broken audio player on Chrome 42 for ogg files (#567) + +If the work fixes one or more issues, the issue number should be included at the end of the fragment ((#567) is the issue number in the previous example). + +If your work is not related to a specific issue, use the merge request identifier instead, like this: + +> Fixed a typo in landing page copy (!342) + +### Naming + +Fragment files should respect the following naming pattern: `changes/changelog.d/<name>.<category>`. Name can be anything describing your work, or simply the identifier of the issue number you are fixing. Category can be one of: + +- `feature`: for new features +- `enhancement`: for enhancements on existing features +- `bugfix`: for bugfixes +- `doc`: for documentation +- `i18n`: for internationalization-related work +- `misc`: for anything else + +### Shortcuts + +Here is a shortcut you can use/adapt to easily create new fragments from command-line: + +```bash +issue="42" +content="Fixed an overflowing issue on small resolutions (#$issue)" +category="bugfix" +echo "$content ($issue)" > changes/changelog.d/$issue.$category +``` + +You can of course create fragments by hand in your text editor, or from Gitlab's +interface as well. + +## Making a release + +To make a new 3.4 release: + +```bash +# setup +export NEXT_RELEASE=3.4 # replace with the next release number +export PREVIOUS_RELEASE=3.3 # replace with the previous release number + +# ensure you have an up-to-date repo +git checkout master +git pull + +# compile changelog +towncrier --version $NEXT_RELEASE --yes + +# polish changelog +# - update the date +# - look for typos +# - add list of contributors via `python3 scripts/get-contributions-stats.py develop $PREVIOUS_RELEASE` +nano CHANGELOG + +# Set the `version` variable to $NEXT_RELEASE +nano setup.cfg + +# commit +git add . +git commit -m "Version bump and changelog for $NEXT_RELEASE" + +# tag +git tag $NEXT_RELEASE + +# publish +git push --tags && git push + +``` \ No newline at end of file diff --git a/README.md b/README.md index e21a0fd26b4918555e6111914f73a890f76d9f57..02cfcbf681c8c8b13757043cc972e5028d515c4f 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,13 @@ A command line interface to interact with Funkwhale servers. # Installation -We provide some prebuilt binaries for Windows and Linux. +This package can be installed via pip: + +``` +pip install funkwhale-cli +``` + +We also provide some prebuilt binaries for Windows and Linux. On Linux: diff --git a/changes/__init__.py b/changes/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/changes/changelog.d/.gitkeep b/changes/changelog.d/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/changes/changelog.d/initial.feature b/changes/changelog.d/initial.feature new file mode 100644 index 0000000000000000000000000000000000000000..14848f02e7551808dcc9b4acf54fb202b559c3d0 --- /dev/null +++ b/changes/changelog.d/initial.feature @@ -0,0 +1 @@ +Created the project and initial functionality. \ No newline at end of file diff --git a/changes/template.rst b/changes/template.rst new file mode 100644 index 0000000000000000000000000000000000000000..d718cdb075658e31cf975d848e42c96d0f2be453 --- /dev/null +++ b/changes/template.rst @@ -0,0 +1,28 @@ +Upgrade via pip or use our prebuilt binaries for Linux or Windows. + +{% for section, _ in sections.items() %} +{% if sections[section] %} +{% for category, val in definitions.items() if category in sections[section]%} +{{ definitions[category]['name'] }}: + +{% if definitions[category]['showcontent'] %} +{% for text in sections[section][category].keys()|sort() %} +- {{ text }} +{% endfor %} + +{% else %} +- {{ sections[section][category]['']|join(', ') }} + +{% endif %} +{% if sections[section][category]|length == 0 %} +No significant changes. + +{% else %} +{% endif %} + +{% endfor %} +{% else %} +No significant changes. + +{% endif %} +{% endfor %} diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..21dd7c106dc42ca536762624c3b387610de3824b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,46 @@ +[tool.towncrier] + package = "changes" + package_dir = "" + filename = "CHANGELOG" + directory = "changes/changelog.d/" + start_string = ".. towncrier\n" + template = "changes/template.rst" + issue_format = "" + title_format = "{version} (unreleased)" + underlines = "-" + + [[tool.towncrier.section]] + path = "" + + [[tool.towncrier.type]] + directory = "feature" + name = "Features" + showcontent = true + + [[tool.towncrier.type]] + directory = "enhancement" + name = "Enhancements" + showcontent = true + + [[tool.towncrier.type]] + directory = "bugfix" + name = "Bugfixes" + showcontent = true + + [[tool.towncrier.type]] + directory = "doc" + name = "Documentation" + showcontent = true + + [[tool.towncrier.type]] + directory = "i18n" + name = "i18n" + showcontent = true + + [[tool.towncrier.type]] + directory = "misc" + name = "Other" + showcontent = true + +[tool.black] + exclude = "(.git|.hg|.mypy_cache|.tox|.venv|_build|buck-out|build|dist|migrations)" diff --git a/setup.cfg b/setup.cfg index 6cb64f211ba014e0aaef6369f6ac10a5adfa95ef..ba4fcfe894fb6e9809de67a175c94481df5cc3cc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,24 +1,37 @@ [metadata] name = funkwhale-cli description = "A command line interface to interact with Funkwhale servers" -version = 0.1.dev0 +version = 0.1.2.dev0 author = The Funkwhale Collective author_email = contact@funkwhale.audio url = https://dev.funkwhale.audio/funkwhale/cli long_description = file: README.md +long_description_content_type = text/markdown license = AGPL3 keywords = cli classifiers = Development Status :: 3 - Alpha - License :: OSI Approved :: AGPL + Intended Audience :: End Users/Desktop + License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+) Natural Language :: English + Operating System :: MacOS :: MacOS X + Operating System :: POSIX + Operating System :: POSIX :: BSD + Operating System :: POSIX :: Linux + Operating System :: Microsoft :: Windows + Programming Language :: Python Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 [options] zip_safe = True include_package_data = True packages = find: +python_requires = >=3.6 install_requires = aiofiles~=0.7.0 aiohttp~=3.7.4 @@ -51,7 +64,15 @@ test = build = pyinstaller~=4.3 +build-pypi = + setuptools~=56.0.0 + wheel~=0.36.2 +publish = + twine~=3.4.1 + +changelog = + towncrier~=21.3.0 [options.packages.find] exclude =