From c0134b35c144b222a857387bd52c4b1cead11fdd Mon Sep 17 00:00:00 2001 From: Robert Forkel Date: Thu, 21 Mar 2024 12:27:24 +0100 Subject: [PATCH] updated package scaffolding --- .github/workflows/python-package.yml | 12 ++--- README.md | 1 - RELEASING.md | 51 ++++++++++--------- pyproject.toml | 4 ++ setup.cfg | 76 ++++++++++++++++++++++++---- setup.py | 43 +--------------- tox.ini | 7 --- 7 files changed, 104 insertions(+), 90 deletions(-) create mode 100644 pyproject.toml delete mode 100644 tox.ini diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index d4657d6..6f0dd31 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9, "3.10"] + python-version: [3.8, 3.9, "3.10", "3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -27,9 +27,3 @@ jobs: - name: Test with pytest run: | pytest - - name: "Convert coverage" - run: "python -m coverage xml" - - name: "Upload coverage to Codecov" - uses: "codecov/codecov-action@v1" - with: - fail_ci_if_error: true diff --git a/README.md b/README.md index eb3ae51..a931e37 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # clld-audio-plugin [![Build Status](https://github.com/clld/clld-audio-plugin/workflows/tests/badge.svg)](https://github.com/clld/clld-audio-plugin/actions?query=workflow%3Atests) -[![codecov](https://codecov.io/gh/clld/clld-audio-plugin/branch/main/graph/badge.svg)](https://codecov.io/gh/clld/clld-audio-plugin) [![PyPI](https://img.shields.io/pypi/v/clld-audio-plugin.svg)](https://pypi.org/project/clld-audio-plugin) A plugin for the [`clld`](https://pypi.org/project/clld) package. diff --git a/RELEASING.md b/RELEASING.md index e4ead3e..293dd87 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,41 +1,46 @@ Releasing clld-audio-plugin =========================== +- PEP8 + ```shell + flake8 src + ``` + - Do platform test via tox (making sure statement coverage is at 100%): -``` -tox -r -``` + ```shell + tox -r + ``` - Change setup.py version to the new version number. - Bump version number: -``` -git commit -a -m"" -``` + ``` + git commit -a -m"" + ``` - Create a release tag: -``` -git tag -a v -m"release " -``` + ``` + git tag -a v -m"release " + ``` - Release to PyPI: -``` -python setup.py clean --all -rm dist/* -python setup.py sdist bdist_wheel -twine upload dist/* -``` + ``` + python setup.py clean --all + rm dist/* + python -m build -n + twine upload dist/* + ``` - Push to github: -``` -git push origin -git push --tags -``` + ```shell + git push origin + git push --tags + ``` - Append `.dev0` to the version number in `setup.py` for the new development cycle. - Commit/push the version change: -```shell -git commit -a -m "bump version for development" -git push origin -``` + ```shell + git commit -a -m "bump version for development" + git push origin + ``` diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1870a2e --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + diff --git a/setup.cfg b/setup.cfg index aeb6ce6..41ac316 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,20 +1,81 @@ [metadata] +name = clld-audio-plugin +version = 1.0.1.dev0 license_file = LICENSE +author = Robert Forkel +author_email = dlce.rdm@eva.mpg.de +classifiers = + Development Status :: 2 - Pre-Alpha + Intended Audience :: Science/Research + License :: OSI Approved :: Apache Software License + Natural Language :: English + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 +description = Render linked audio files in clld apps. +long_description = file: README.md +long_description_content_type = text/markdown +project_urls = + Bug Tracker = https://github.com/clld/clld-audio-plugin/issues +url = https://github.com/clld/clld-audio-plugin + +[options] +zip_safe = False +include_package_data = True +packages = find: +package_dir = + =src +install_requires = + clld>=7 + sqlalchemy + zope.interface + +[options.extras_require] +dev = + flake8 + twine + wheel + build +test = + pytest + pytest-mock + pytest-cov + tox + webtest + +[options.packages.find] +include = clld_audio_plugin +where = src [bdist_wheel] universal = 1 +[easy_install] +zip_ok = false + +[tool:pytest] +addopts = --cov +testpaths = tests +filterwarnings = + ignore::sqlalchemy.exc.RemovedIn20Warning + +[tox:tox] +envlist = py38, py39, py310, py311, py312 +isolated_build = true +skip_missing_interpreter = true + +[testenv] +deps = .[test] +commands = pytest {posargs} + [flake8] ignore = E711,E712,D100,D101,D103,D102,D301 max-line-length = 100 exclude = .tox -[tool:pytest] -minversion = 5 -testpaths = tests -addopts = - --cov - [coverage:run] source = clld_audio_plugin @@ -22,6 +83,3 @@ source = [coverage:report] show_missing = true - -[easy_install] -zip_ok = false diff --git a/setup.py b/setup.py index 01d61df..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,42 +1,3 @@ -from setuptools import setup, find_packages +from setuptools import setup -setup( - name='clld-audio-plugin', - version='1.0.1.dev0', - description='clld-audio-plugin', - classifiers=[ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='Robert Forkel', - author_email='dlce.rdm@eva.mpg.de', - url='https://github.com/clld/clld-audio-plugin', - keywords='web pyramid pylons', - packages=find_packages(where="src"), - package_dir={"": "src"}, - include_package_data=True, - zip_safe=False, - install_requires=[ - 'clld>=7', - 'sqlalchemy', - 'zope.interface', - ], - extras_require={ - 'dev': ['flake8', 'wheel', 'twine'], - 'test': [ - 'pytest>=5', - 'pytest-mock', - 'coverage>=4.2', - 'pytest-cov', - 'webtest', - ], - }, - license="Apache 2.0", -) +setup() diff --git a/tox.ini b/tox.ini deleted file mode 100644 index a9b50c6..0000000 --- a/tox.ini +++ /dev/null @@ -1,7 +0,0 @@ -[tox] -envlist = py{37,38,39,310} -skip_missing_interpreters = true - -[testenv] -extras = test -commands = pytest {posargs}