diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 5982ccb..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: -jobs: - checks: - name: Checks - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - name: Use pip cache - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: pip-${{ hashFiles('**/requirements*.txt') }} - restore-keys: | - pip- - - name: Install development tools - run: | - pip install -r requirements.dev.txt - pip install build twine nox - - name: Tests - python3 -m pytest - - name: Check distribution build - run: | - python3 -m build - python3 -m twine check dist/* - - # Disabling for now. - # docs: - # name: Build documentation - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v2 - # - name: Setup Python 3.8 - # uses: actions/setup-python@v2 - # with: - # python-version: 3.8 - # - name: Use pip cache - # uses: actions/cache@v2 - # with: - # path: ~/.cache/pip - # key: pip-${{ hashFiles('**/requirements*.txt') }} - # restore-keys: | - # pip- - # - name: Install nox - # run: pip install nox - # - name: Build docs - # run: nox -s build_docs - # - name: Publish to GitHub Pages - # if: github.event_name == 'push' - # run: | - # # Create empty gh-pages branch - # git checkout --orphan gh-pages - - # # Remove files other than docs - # git rm -rf . - # rm -rf .nox - # find . -name __pycache__ | xargs rm -r - - # # Move docs to root - # mv docs/html/* ./ - # rm -r docs - - # # Prevent GitHub from assuming that this is a Jekyll site - # touch .nojekyll - - # git config user.name "${GITHUB_ACTOR}" - # git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - # git add . - # git commit --allow-empty -m "Update docs" - - # git push --force origin gh-pages - - # # Restore the original working tree by checking out the - # # commit that triggered the workflow. - # # This restores requirements.txt so that @actions/cache - # # can use it for determining the cache key. - # git checkout ${GITHUB_SHA} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..af0cf96 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: Tests + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Display Python version + run: python -c "import sys; print(sys.version)" + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: Run tests + run: python -m pytest -vs diff --git a/requirements.dev.in b/requirements.dev.in deleted file mode 100644 index 2ae764b..0000000 --- a/requirements.dev.in +++ /dev/null @@ -1,6 +0,0 @@ -black==21.9b0 # This should be kept in sync with the version in .pre-commit-config.yaml -isort==5.9.3 # This should be kept in sync with the version in .pre-commit-config.yaml -pylint -pytest -msprime -tskit diff --git a/requirements.dev.txt b/requirements.dev.txt deleted file mode 100644 index aedf1e7..0000000 --- a/requirements.dev.txt +++ /dev/null @@ -1,93 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.8 -# To update, run: -# -# pip-compile requirements.dev.in -# -astroid==2.9.3 - # via pylint -attrs==21.4.0 - # via - # demes - # jsonschema - # pytest -black==21.9b0 - # via -r requirements.dev.in -click==8.0.4 - # via black -demes==0.2.1 - # via msprime -importlib-resources==5.4.0 - # via jsonschema -iniconfig==1.1.1 - # via pytest -isort==5.9.3 - # via - # -r requirements.dev.in - # pylint -jsonschema==4.4.0 - # via tskit -lazy-object-proxy==1.7.1 - # via astroid -mccabe==0.6.1 - # via pylint -msprime==1.1.1 - # via -r requirements.dev.in -mypy-extensions==0.4.3 - # via black -newick==1.3.2 - # via msprime -numpy==1.22.2 - # via - # msprime - # tskit -packaging==21.3 - # via pytest -pathspec==0.9.0 - # via black -platformdirs==2.5.1 - # via - # black - # pylint -pluggy==1.0.0 - # via pytest -py==1.11.0 - # via pytest -pylint==2.12.2 - # via -r requirements.dev.in -pyparsing==3.0.7 - # via packaging -pyrsistent==0.18.1 - # via jsonschema -pytest==7.0.1 - # via -r requirements.dev.in -regex==2022.1.18 - # via black -ruamel-yaml==0.17.21 - # via demes -ruamel-yaml-clib==0.2.6 - # via ruamel-yaml -svgwrite==1.4.1 - # via tskit -toml==0.10.2 - # via pylint -tomli==1.2.3 - # via - # black - # pytest -tskit==0.4.1 - # via - # -r requirements.dev.in - # msprime -typing-extensions==4.1.1 - # via - # astroid - # black - # pylint -wrapt==1.13.3 - # via astroid -zipp==3.7.0 - # via importlib-resources - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..553f70f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +black +pytest +msprime +tskit +numba