Migrate setup.py to pyproject.toml #1011
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow runs only on Ubuntu and aims to be more complete than the Mac and Windows workflows. | |
# In particular, Open Babel and many of the external command line dependencies are included for testing.defaults: | |
# The ext package is also only tested in this workflow. Coverage is also computed based on this platform. | |
name: Testing | |
permissions: | |
contents: read | |
env: | |
PYTEST_ADDOPTS: "--color=yes" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
fullTest: | |
description: "run full test" | |
required: true | |
default: false | |
type: boolean | |
jobs: | |
test: | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
mongodb-version: ['4.0'] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
PMG_MAPI_KEY: ${{ secrets.PMG_MAPI_KEY }} | |
MPDS_KEY: ${{ secrets.MPDS_KEY }} | |
CITRINATION_API_KEY: ${{ secrets.CITRINATION_API_KEY }} | |
RUNNING_ON_GHACTIONS: "True" | |
MPLBACKEND: "Agg" | |
MATMINER_DATASET_FULL_TEST: ${{ inputs.fullTest }} | |
services: | |
mongo: | |
image: mongo:4 | |
ports: | |
- 27017:27017 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: "pip" | |
cache-dependency-path: '**/setup.py' | |
- name: Install Python dependencies | |
run: | | |
python${{ matrix.python-version }} -m pip install --upgrade pip pip-tools | |
python${{ matrix.python-version }} -m piptools sync --user requirements/ubuntu-latest_py${{ matrix.python-version }}.txt | |
# Using non-editable install for testing building of MANIFEST files | |
python${{ matrix.python-version }} -m pip install --no-deps . | |
- name: linting | |
run: | | |
python${{ matrix.python-version }} -m pip install pre-commit | |
pre-commit run --all-files | |
- name: Run tests | |
run: | | |
python${{ matrix.python-version }} -m pytest --cov=matminer matminer --durations=20 --timeout=360 | |
- name: Build package | |
if: matrix.python-version == 3.9 | |
run: | | |
python${{ matrix.python-version }} -m build | |
auto-gen-release: | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
if: github.repository == 'hackingmaterials/matminer' | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
steps: | |
- uses: rymndhng/[email protected] | |
with: | |
bump_version_scheme: norelease |