Skip to content

Commit

Permalink
Update all workflows to use python -m pysr test syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Feb 7, 2024
1 parent 98fa83e commit 4320392
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 24 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,22 @@ jobs:
run: pip install coverage coveralls
- name: "Run tests"
run: |
coverage run --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test main
coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test cli
coverage run --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr test main
coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr test cli
- name: "Install JAX"
run: pip install jax jaxlib # (optional import)
if: ${{ matrix.test-id == 'main' }}
- name: "Run JAX tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test jax
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr test jax
if: ${{ matrix.test-id == 'main' }}
- name: "Install Torch"
run: pip install torch # (optional import)
if: ${{ matrix.test-id == 'main' }}
- name: "Run Torch tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test torch
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr test torch
if: ${{ matrix.test-id == 'main' }}
- name: "Run custom env tests"
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr.test env
run: coverage run --append --source=pysr --omit='*/test/*,*/feynman_problems.py' -m pysr test env
- name: "Coveralls"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -95,7 +95,7 @@ jobs:
- name: "Build incremental install"
run: docker build -t pysr -f pysr/test/incremental_install_simulator.dockerfile .
- name: "Test incremental install"
run: docker run --rm pysr /bin/bash -l -c 'python3 -m pysr.test main && python3 -m pysr.test env'
run: docker run --rm pysr /bin/bash -l -c 'python3 -m pysr test main && python3 -m pysr test env'

conda_test:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
python3 -m pip install .
python3 -m pysr install
- name: "Run tests"
run: cd /tmp && python -m pysr.test main
run: cd /tmp && python -m pysr test main

coveralls:
name: Indicate completion to coveralls.io
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/CI_Windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
python -m pysr install
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
python -m pysr test main
python -m pysr test cli
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m pysr.test torch
run: python -m pysr test torch
- name: "Run custom env tests"
run: python -m pysr.test env
run: python -m pysr test env
2 changes: 1 addition & 1 deletion .github/workflows/CI_conda_forge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
run: conda activate pysr-test && conda install pysr
if: ${{ !matrix.use-mamba }}
- name: "Run tests"
run: python -m pysr.test main
run: python -m pysr test main
2 changes: 1 addition & 1 deletion .github/workflows/CI_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
- name: Build docker
run: docker build --platform=${{ matrix.arch }} -t pysr .
- name: Test docker
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr.test main && python3 -m pysr.test cli && python3 -m pysr.test env'
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr test main && python3 -m pysr test cli && python3 -m pysr test env'
2 changes: 1 addition & 1 deletion .github/workflows/CI_docker_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- name: Build docker
run: docker build --platform=${{ matrix.arch }} -t pysr --build-arg JLVERSION=${{ matrix.julia-version }} --build-arg PYVERSION=${{ matrix.python-version }} .
- name: Test docker
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr.test main && python3 -m pysr.test cli && python3 -m pysr.test env'
run: docker run --platform=${{ matrix.arch }} --rm pysr /bin/bash -c 'python3 -m pysr test main && python3 -m pysr test cli && python3 -m pysr test env'
6 changes: 3 additions & 3 deletions .github/workflows/CI_large_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
python -m pysr install
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
python -m pysr test main
python -m pysr test cli
- name: "Run new env test"
run: python -m pysr.test env
run: python -m pysr test env
if: ${{ !(matrix.os == 'windows-latest' && matrix.python-version == '3.7') }}
10 changes: 5 additions & 5 deletions .github/workflows/CI_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ jobs:
python -m pysr install
- name: "Run tests"
run: |
python -m pysr.test main
python -m pysr.test cli
python -m pysr test main
python -m pysr test cli
- name: "Install JAX"
run: pip install jax jaxlib # (optional import)
- name: "Run JAX tests"
run: python -m pysr.test jax
run: python -m pysr test jax
- name: "Install Torch"
run: pip install torch # (optional import)
- name: "Run Torch tests"
run: python -m pysr.test torch
run: python -m pysr test torch
- name: "Run custom env tests"
run: python -m pysr.test env
run: python -m pysr test env
2 changes: 1 addition & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Scan through our [existing issues](https://github.com/MilesCranmer/PySR/issues)
check out the [guide](https://astroautomata.com/PySR/backend/) on modifying a custom SymbolicRegression.jl library.
In this case, you might instead be interested in making suggestions to the [SymbolicRegression.jl](http://github.com/MilesCranmer/SymbolicRegression.jl) library.

4. You can install your local version of PySR with `python setup.py install`, and run tests with `python -m pysr.test main`.
4. You can install your local version of PySR with `python setup.py install`, and run tests with `python -m pysr test main`.

### Commit your update

Expand Down
1 change: 0 additions & 1 deletion pysr/test/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
if __name__ == "__main__":
# Get args:
parser = argparse.ArgumentParser()
parser.usage = "python -m pysr.test [tests...]"
parser.add_argument(
"test",
nargs="*",
Expand Down

0 comments on commit 4320392

Please sign in to comment.