Skip to content

Commit

Permalink
CI Use GitHub Actions (#16)
Browse files Browse the repository at this point in the history
* CI Use GitHub Actions

* Require Python>=3.9

* Add pyproject.toml

* Fix version
  • Loading branch information
VarIr authored Sep 15, 2023
1 parent 3e3b5a8 commit 7c7adc1
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion copac/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
__all__ = [
'COPAC',
'copac',
'__version__',
]
__version__ = "0.2.1"
__version__ = "0.3.0"
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build-system]
# Minimum requirements for the build system to execute.
requires = [
"setuptools>=60",
"setuptools_scm>=6.2",
"wheel",
]

8 changes: 3 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ universal = true

[metadata]
name = COPAC
version = attr: copac.__version__
version = 0.3.0
author = Roman Feldbauer
author_email = [email protected]
url = https://github.com/VarIr/copac
Expand All @@ -19,20 +19,18 @@ 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
[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
Expand Down

0 comments on commit 7c7adc1

Please sign in to comment.