diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3bc2b18..ea23d44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,4 @@ +--- name: CI on: [push] @@ -7,33 +8,26 @@ jobs: runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10'] + + name: Python ${{ matrix.python-version }} steps: - - uses: actions/checkout@v1 - - - name: Set up Python 3.5 - uses: actions/setup-python@v1 - with: - python-version: 3.5 - - - name: Set up Python 3.6 - uses: actions/setup-python@v1 - with: - python-version: 3.6 - - - name: Set up Python 3.7 - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - - name: Set up Python 3.8 - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - - name: Install CI dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - - - name: Run tests - run: tox + - uses: actions/checkout@v2.3.5 + + - name: Set up Python + uses: actions/setup-python@v2.2.2 + with: + python-version: ${{ matrix.python-version }} + + - name: Update pip and install dev requirements + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Lint + run: make lint + + - name: Test + run: tox diff --git a/LICENSE b/LICENSE index 129ba69..bfdc928 100644 --- a/LICENSE +++ b/LICENSE @@ -2,7 +2,7 @@ License ======= -Copyright (c) 2013-2014 Will Kahn-Greene +Copyright (c) 2013-2022 Will Kahn-Greene All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Makefile b/Makefile index e466e58..8126f9e 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,17 @@ help: .PHONY: clean clean: ## Clean build artifacts - rm -rf build dist dennis.egg-info .tox + rm -rf build dist dennis.egg-info rm -rf docs/_build/* + rm -rf _pytest_cache/ .tox find dennis/ tests/ -name __pycache__ | xargs rm -rf find dennis/ tests/ -name '*.pyc' | xargs rm -rf .PHONY: lint lint: ## Lint and black reformat files - black --target-version=py35 dennis tests + black --target-version=py37 setup.py dennis tests flake8 dennis tests + +.PHONY: test +test: ## Run tests + tox diff --git a/requirements-dev.txt b/requirements-dev.txt index 80781cd..d00f709 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,12 +1,12 @@ -e . # tools -black==19.3b0 ; python_version >= '3.6' -check-manifest==0.37 -flake8==3.7.8 -pytest==3.7.2 -pytest-wholenodeid==0.2 -Sphinx==1.7.7 -tox==3.2.1 -twine==1.11.0 -wheel==0.31.1 +black==22.3.0 +check-manifest==0.48 +flake8==4.0.1 +pytest==7.1.2 +Sphinx==4.3.2 +tox==3.25.0 +tox-gh-actions==2.9.1 +twine==4.0.1 +wheel==0.37.1 diff --git a/setup.py b/setup.py index 49975f8..733ed2a 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ ####################################################################### # This file is part of dennis. # -# Copyright (C) 2013-2014 Will Kahn-Greene +# Copyright (C) 2013-2022 Will Kahn-Greene # Licensed under the Simplified BSD License. See LICENSE for full # license. ####################################################################### @@ -11,55 +11,55 @@ import os -READMEFILE = 'README.rst' -VERSIONFILE = os.path.join('dennis', '__init__.py') +READMEFILE = "README.rst" +VERSIONFILE = os.path.join("dennis", "__init__.py") VSRE = r"""^__version__ = ['"]([^'"]*)['"]""" def get_version(): - version_file = open(VERSIONFILE, 'rt').read() + version_file = open(VERSIONFILE, "rt").read() return re.search(VSRE, version_file, re.M).group(1) setup( - name='dennis', + name="dennis", version=get_version(), description=( - 'Utilities for working with PO and POT files to ease development ' - 'and improve localization quality' + "Utilities for working with PO and POT files to ease development " + "and improve localization quality" ), long_description=open(READMEFILE).read(), - license='Simplified BSD License', - author='Will Kahn-Greene', - author_email='willkg@bluesock.org', - keywords='l10n localization PO POT lint translate development', - url='https://github.com/willkg/dennis', + license="Simplified BSD License", + author="Will Kahn-Greene", + author_email="willkg@bluesock.org", + keywords="l10n localization PO POT lint translate development", + url="https://github.com/willkg/dennis", zip_safe=True, packages=find_packages(), include_package_data=True, install_requires=[ - 'polib>=1.0.8', - 'click>=6', + "polib>=1.0.8", + "click>=6", ], entry_points=""" [console_scripts] dennis-cmd=dennis.cmdline:click_run """, - python_requires='>=3.5', + python_requires=">=3.7", classifiers=[ - 'Development Status :: 4 - Beta', - 'Environment :: Console', - 'License :: OSI Approved :: BSD License', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: POSIX', - 'Operating System :: POSIX :: Linux', - 'Operating System :: Unix', - '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', - 'Programming Language :: Python :: 3 :: Only', + "Development Status :: 4 - Beta", + "Environment :: Console", + "License :: OSI Approved :: BSD License", + "Operating System :: MacOS :: MacOS X", + "Operating System :: POSIX", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "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", + "Programming Language :: Python :: 3 :: Only", ], ) diff --git a/tox.ini b/tox.ini index 8e0938b..4c08666 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,14 @@ -# Tox (https://tox.readthedocs.io/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - [tox] -envlist = py35,py36,py37,py38,py36-lint - -[testenv] -commands = pip install -r requirements-dev.txt - pytest +envlist = py37,py38,py39,py310 +[gh-actions] +python = + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310 -[testenv:py36-lint] -basepython = python3.6 -commands = pip install -r requirements-dev.txt - black --check --target-version=py35 dennis tests - flake8 dennis tests +[testenv] +commands = + pip install -r requirements-dev.txt + {posargs:pytest tests/}