From 39a806ffdf5dd5162f599f3b2fd8e7fcd0cb9d96 Mon Sep 17 00:00:00 2001 From: Robert Forkel Date: Thu, 7 Dec 2023 08:55:43 +0100 Subject: [PATCH] updated project layout --- .github/workflows/python-package.yml | 12 ++--- README.md | 1 - RELEASING.md | 12 ++--- pyproject.toml | 3 ++ setup.cfg | 73 +++++++++++++++++++++++++++- setup.py | 48 +----------------- tox.ini | 7 --- 7 files changed, 84 insertions(+), 72 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 b8323ec..6533344 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.5, 3.6] + python-version: ["3.10"] 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@v4 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 0684367..8999e36 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ visualization. [![Build Status](https://github.com/clld/clld-glottologfamily-plugin/workflows/tests/badge.svg)](https://github.com/clld/clld-glottologfamily-plugin/actions?query=workflow%3Atests) -[![codecov.io](http://codecov.io/github/clld/clld-glottologfamily-plugin/coverage.svg?branch=master)](http://codecov.io/github/clld/clld-glottologfamily-plugin?branch=master) [![PyPI](https://img.shields.io/pypi/v/clld-glottologfamily-plugin.svg)](https://pypi.python.org/pypi/clld-glottologfamily-plugin) diff --git a/RELEASING.md b/RELEASING.md index 1fdc4dd..575076d 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -2,12 +2,12 @@ Releasing clld-glottologfamily-plugin ===================================== - Do platform test via tox: -``` +```shell tox -r ``` - Make sure flake8 passes: -``` +```shell flake8 src ``` @@ -29,15 +29,12 @@ git tag -a v -m" release" ```shell python setup.py clean --all rm dist/* -python setup.py sdist -twine upload dist/* -rm dist/* -python setup.py bdist_wheel +python -m build -n twine upload dist/* ``` - Push to github: -``` +```shell git push origin git push --tags ``` @@ -51,4 +48,3 @@ git push --tags 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..fed528d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg index c19f558..baff3e0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,63 @@ [metadata] -license_file = LICENSE +name = clld-glottologfamily-plugin +version = 4.0.1.dev0 +author = Robert Forkel +author_email = dlce.rdm@eva.mpg.de +description = A clld plugin adding language family information from Glottolog +long_description = file: README.md +long_description_content_type = text/markdown +keywords = web pyramid clld +license = Apache 2.0 +license_files = LICENSE +url = https://github.com/clld/clld-glottologfamily-plugin +platforms = any +classifiers = + Development Status :: 5 - Production/Stable + Intended Audience :: Developers + Natural Language :: English + Operating System :: OS Independent + 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 + License :: OSI Approved :: Apache Software License + +[options] +zip_safe = False +packages = find: +package_dir = + = src +python_requires = >=3.8 +install_requires = + clld>=7.0 + sqlalchemy + zope.interface + pybtex + pyglottolog>=2.0 +include_package_data = True + +[options.packages.find] +where = src + +[options.package_data] +clld_glottologfamily_plugin = + templates/* + +[options.extras_require] +dev = + flake8 + wheel + build + twine +test = + pytest>=5 + pytest-mock + pytest-cov + pytest-clld + coverage>=4.2 + webtest [bdist_wheel] universal = 1 @@ -14,6 +72,9 @@ minversion = 5 testpaths = tests addopts = --cov +filterwarnings = + ignore::sqlalchemy.exc.SAWarning + ignore::sqlalchemy.exc.RemovedIn20Warning [coverage:run] source = @@ -22,6 +83,16 @@ source = [coverage:report] show_missing = true +skip_covered = true [easy_install] zip_ok = false + +[tox:tox] +envlist = py38, py39, py310, py311, py312 +isolated_build = true +skip_missing_interpreter = true + +[testenv] +deps = .[test] +commands = pytest {posargs} diff --git a/setup.py b/setup.py index 9045a7d..b024da8 100644 --- a/setup.py +++ b/setup.py @@ -1,48 +1,4 @@ -from setuptools import setup, find_packages +from setuptools import setup -setup( - name='clld-glottologfamily-plugin', - version='4.0.1.dev0', - description='clld-glottologfamily-plugin', - classifiers=[ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Framework :: Pyramid", - "Topic :: Internet :: WWW/HTTP", - "Topic :: Internet :: WWW/HTTP :: WSGI :: Application", - ], - author='Robert Forkel', - author_email='forkel@shh.mpg.de', - url='https://github.com/clld/clld-glottologfamily-plugin', - keywords='web pyramid pylons', - packages=find_packages(where="src"), - package_dir={"": "src"}, - include_package_data=True, - zip_safe=False, - install_requires=[ - 'clld>=7.0', - 'sqlalchemy', - 'zope.interface', - 'pybtex<0.23; python_version < "3.6"', - 'pybtex; python_version > "3.5"', - 'pyglottolog>=2.0', - ], - extras_require={ - 'dev': ['flake8', 'wheel', 'twine'], - 'test': [ - 'attrs>=19.2', - 'pytest>=5.4', - 'pytest-mock', - 'pytest-clld', - 'coverage>=4.2', - 'pytest-cov', - 'webtest', - ], - }, - license="Apache 2.0", -) +setup() diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 1ff9207..0000000 --- a/tox.ini +++ /dev/null @@ -1,7 +0,0 @@ -[tox] -envlist = py{35,36,37,38} -skip_missing_interpreters = true - -[testenv] -extras = test -commands = pytest {posargs}