diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..cbf7538 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,38 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: Python package + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install --upgrade pip + pip install flake8 pytest sympy + - name: Install package + run: | + pip install -r requirements.txt + pip install -r test-requirements.txt + pip install . + - name: Test with pytest + run: | + pytest diff --git a/requirements.txt b/requirements.txt index 0a25444..bd1872d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ # List of requirements # Run -sympy>=1.12 -numpy>=1.25.2 - +sympy +numpy diff --git a/setup.py b/setup.py index b4965f1..5c768e0 100644 --- a/setup.py +++ b/setup.py @@ -10,8 +10,13 @@ import sys from setuptools import setup, find_packages -from abelian import __version__ -VERSION = __version__ +import re +import ast + +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('abelian/__init__.py', 'rb') as f: + VERSION = str(ast.literal_eval(_version_re.search(f.read().decode('utf-8')).group(1))) with open('README.rst', 'r') as file: README_TEXT = file.read()