From e6ea79371b771854914648583dbcdbe3e7e466f7 Mon Sep 17 00:00:00 2001 From: Julia Signell Date: Mon, 3 Feb 2025 22:07:17 +0100 Subject: [PATCH] Remove scripts except `pull-static` (#1519) * Remove scripts except `pull-static` * Add default pytest options --- .github/pull_request_template.md | 3 ++- .github/workflows/continuous-integration.yml | 2 +- docs/contributing.rst | 4 ++-- pyproject.toml | 1 + scripts/bench | 11 ----------- scripts/pull-static | 2 +- scripts/test | 18 ------------------ 7 files changed, 7 insertions(+), 34 deletions(-) delete mode 100755 scripts/bench delete mode 100755 scripts/test diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a782c6c5e..3fd45128a 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,7 +6,8 @@ **PR Checklist:** -- [ ] Pre-commit hooks and tests pass (run `scripts/test`) +- [ ] Pre-commit hooks pass (run `pre-commit run --all-files`) +- [ ] Tests pass (run `pytest`) - [ ] Documentation has been updated to reflect changes, if applicable - [ ] This PR maintains or improves overall codebase code coverage. - [ ] Changes are added to the [CHANGELOG](https://github.com/stac-utils/pystac/blob/main/CHANGELOG.md). See [the docs](https://pystac.readthedocs.io/en/latest/contributing.html#changelog) for information about adding to the changelog. diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d178332bf..dee1329ae 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -49,7 +49,7 @@ jobs: run: uv run pytest tests - name: Test if: runner.os != 'Windows' - run: uv run scripts/test + run: uv run pytest tests --block-network --record-mode=none coverage: name: coverage diff --git a/docs/contributing.rst b/docs/contributing.rst index 2e2ae18ca..af2d32610 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -33,7 +33,7 @@ To run the tests and generate the coverage report: .. code-block:: bash - $ pytest -v -s --block-network --cov pystac --cov-report term-missing + $ pytest -v -s --cov pystac --cov-report term-missing To view the coverage report, you can run `coverage report` (to view the report in the terminal) or `coverage html` (to generate @@ -100,7 +100,7 @@ and report any improvements or regressions. .. code-block:: bash - scripts/bench + asv continuous --split -e --interleave-rounds --factor 1.25 main HEAD The benchmark suite takes a while to run, and will report any significant changes to standard output. For example, here's a benchmark comparison between diff --git a/pyproject.toml b/pyproject.toml index 4bea2e1bf..74bf4d847 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -105,6 +105,7 @@ lint.select = ["E", "F", "I"] [tool.pytest.ini_options] filterwarnings = ["error"] +addopts = "--block-network --record-mode=none" [tool.setuptools.packages.find] include = ["pystac*"] diff --git a/scripts/bench b/scripts/bench deleted file mode 100755 index b86a44bc2..000000000 --- a/scripts/bench +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -z $ASV_FACTOR ]]; then - ASV_FACTOR=1.25; -fi - -asv continuous --split -e --interleave-rounds \ - --factor ${ASV_FACTOR} \ - main HEAD; diff --git a/scripts/pull-static b/scripts/pull-static index 57b4f3207..46b6b27b8 100755 --- a/scripts/pull-static +++ b/scripts/pull-static @@ -2,7 +2,7 @@ set -e -VERSION="1.5.0" #v1.5.0-beta.2 should work or no?? +VERSION="1.5.0" SRC="https://cdn.jsdelivr.net/npm/@radiantearth/stac-fields@$VERSION/fields-normalized.json" HERE=$(dirname "$0") DEST=$(dirname "$HERE")/pystac/static/fields-normalized.json diff --git a/scripts/test b/scripts/test deleted file mode 100755 index 158e7f7d7..000000000 --- a/scripts/test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -set -e - -if [[ -z ${CI} ]]; then - pre-commit run --all-files -fi -echo - -if [[ -z ${CI} || -n ${CHECK_COVERAGE} ]]; then - echo " -- RUNNING UNIT TESTS (WITH COVERAGE) --" - pytest tests --block-network --record-mode=none --cov -else - echo " -- RUNNING UNIT TESTS (WITHOUT COVERAGE) --" - pytest tests --block-network --record-mode=none -fi - -echo