From 7c7adc1b69b23807c591cb42c66f33bf5fbfb1b0 Mon Sep 17 00:00:00 2001 From: Roman Feldbauer Date: Fri, 15 Sep 2023 12:00:59 +0200 Subject: [PATCH] CI Use GitHub Actions (#16) * CI Use GitHub Actions * Require Python>=3.9 * Add pyproject.toml * Fix version --- .github/workflows/python-app.yml | 44 ++++++++++++++++++++++++++++++++ copac/__init__.py | 3 ++- pyproject.toml | 8 ++++++ setup.cfg | 8 +++--- 4 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/python-app.yml create mode 100644 pyproject.toml diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..6705e17 --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python application + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python (current version from matrix defined above) + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install copac + run: python3 -m pip install . + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Test with pytest + run: | + pytest diff --git a/copac/__init__.py b/copac/__init__.py index 4e2150e..f1c96c9 100644 --- a/copac/__init__.py +++ b/copac/__init__.py @@ -3,5 +3,6 @@ __all__ = [ 'COPAC', 'copac', + '__version__', ] -__version__ = "0.2.1" +__version__ = "0.3.0" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..0003064 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,8 @@ +[build-system] +# Minimum requirements for the build system to execute. +requires = [ + "setuptools>=60", + "setuptools_scm>=6.2", + "wheel", +] + diff --git a/setup.cfg b/setup.cfg index 2f581be..a031533 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,7 @@ universal = true [metadata] name = COPAC -version = attr: copac.__version__ +version = 0.3.0 author = Roman Feldbauer author_email = sci@feldbauer.org url = https://github.com/VarIr/copac @@ -19,12 +19,10 @@ classifiers = Intended Audience :: Science/Research Programming Language :: Python Programming Language :: Python :: 3", - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - 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 Topic :: Scientific/Engineering project_urls = Bug Tracker = https://github.com/VarIr/copac/issues @@ -32,7 +30,7 @@ project_urls = [options] package_dir= =copac -python_requires = >= 3.6 +python_requires = >= 3.9 packages = find: # The following plus setuptools-scm include all version-controlled files in the package. include_package_data = True