diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..21020d0 --- /dev/null +++ b/.github/workflows/python-package.yml @@ -0,0 +1,58 @@ +# 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: + - main + pull_request: + branches: + - main + - devel + - packaging-updates + types: + - opened + - reopened + - synchronize + - ready_for_review + + +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request'}} + +jobs: + build-lint-pytest: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install uv + python -m pip install flake8 pytest + uv pip compile pyproject.toml -o requirements.txt + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - 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: Install package + run: pip install -e . + - name: Test with pytest + run: | + pytest diff --git a/.gitignore b/.gitignore index 1c01d4a..2c3d1e6 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ __pycache__ ../build dist *egg-info -*.pyc \ No newline at end of file +*.pyc + +*.DS_Store +*.vscode \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 99fb886..5e134fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,8 @@ authors = [ { name = "Xander Mensah", email = "xmen@umich.edu" }, { name = "Katsuyo Thornton", email = "kthorn@umich.edu" } ] -license = { file = "LICENSE.md" } +license = "MIT" +license-files = ["LICENSE.md"] readme = "README.md" requires-python = ">=2.7, <4" @@ -50,7 +51,6 @@ dependencies = [ classifiers=[ 'Development Status :: 1 - Planning', 'Intended Audience :: Science/Research', - 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', @@ -58,5 +58,8 @@ classifiers=[ 'Programming Language :: Python :: 3.5', ] +[tool.setuptools.packages.find] +include = ["ammber"] + [project.urls] Homepage = "https://github.com/UMThorntongroup/" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..e177e12 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,89 @@ +# This file was autogenerated by uv via the following command: +# uv pip compile pyproject.toml -o requirements.txt +contourpy==1.3.0 + # via matplotlib +coverage==7.8.0 + # via pytest-cov +cycler==0.12.1 + # via matplotlib +flexcache==0.3 + # via pint +flexparser==0.4 + # via pint +fonttools==4.57.0 + # via matplotlib +iniconfig==2.1.0 + # via pytest +kiwisolver==1.4.8 + # via matplotlib +matplotlib==3.10.1 + # via pycalphad +numpy==1.26.4 + # via + # ammber (pyproject.toml) + # contourpy + # matplotlib + # pandas + # pycalphad + # scipy + # xarray +packaging==24.2 + # via + # matplotlib + # pytest + # setuptools-scm + # xarray +pandas==2.2.3 + # via xarray +pillow==11.2.1 + # via matplotlib +pint==0.24.4 + # via pycalphad +platformdirs==4.3.7 + # via pint +pluggy==1.5.0 + # via pytest +pycalphad==0.11.0 + # via ammber (pyproject.toml) +pyparsing==3.2.3 + # via + # matplotlib + # pycalphad +pytest==8.3.5 + # via + # pycalphad + # pytest-cov +pytest-cov==6.1.1 + # via pycalphad +python-dateutil==2.9.0.post0 + # via + # matplotlib + # pandas +pytz==2025.2 + # via pandas +runtype==0.5.3 + # via pycalphad +scipy==1.15.2 + # via + # ammber (pyproject.toml) + # pycalphad +setuptools==78.1.0 + # via setuptools-scm +setuptools-scm==8.2.0 + # via pycalphad +six==1.17.0 + # via python-dateutil +symengine==0.14.0 + # via pycalphad +tinydb==4.8.2 + # via pycalphad +typing-extensions==4.13.2 + # via + # flexcache + # flexparser + # pint + # pycalphad +tzdata==2025.2 + # via pandas +xarray==2025.3.1 + # via pycalphad