diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..8ac6b8c4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba2056a2..03164993 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,6 +47,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: + default_python: '3.9' submodules: false pytest: false toxdeps: tox-pypi-filter @@ -69,12 +70,8 @@ jobs: envs: | - linux: py311-online - cron: - if: | - github.event_name == 'workflow_dispatch' || ( - github.event_name == 'pull_request' && - contains(github.event.pull_request.labels.*.name, 'Run cron CI') - ) + devdeps: + needs: [online] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: submodules: false @@ -87,8 +84,35 @@ jobs: - libhdf5-dev envs: | - linux: py311-devdeps - - linux: py39-conda - libraries: '' + + conda: + needs: [online] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - uses: conda-incubator/setup-miniconda@v2 + with: + installer-url: https://github.com/conda-forge/miniforge/releases/download/4.8.3-2/Miniforge-pypy3-4.8.3-2-Linux-x86_64.sh + python-version: 3.11 + activate-environment: sunkit_image_test + environment-file: sunkit-dev-env.yml + - name: Install sunkit_image + shell: bash -el {0} + run: | + pip install --no-deps --no-build-isolation . + - name: Run tests + shell: bash -el {0} + run: | + conda list + cd /tmp + pytest -vvv -r a --pyargs sunkit_image --cov-report=xml --cov=sunkit_image --cov-config=$GITHUB_WORKSPACE/setup.cfg $GITHUB_WORKSPACE/docs -n auto + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ./coverage.xml publish: # Build wheels when pushing to any branch except main @@ -106,6 +130,7 @@ jobs: needs: [test] uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@main with: + python-version: "3.11" test_extras: 'dev' test_command: 'pytest -p no:warnings --doctest-rst -m "not mpl_image_compare" --pyargs sunkit_image' submodules: false diff --git a/.github/workflows/scheduled_builds.yml b/.github/workflows/scheduled_builds.yml deleted file mode 100644 index 84642570..00000000 --- a/.github/workflows/scheduled_builds.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Scheduled builds - -on: - # Allow manual runs through the web UI - workflow_dispatch: - schedule: - # ┌───────── minute (0 - 59) - # │ ┌───────── hour (0 - 23) - # │ │ ┌───────── day of the month (1 - 31) - # │ │ │ ┌───────── month (1 - 12 or JAN-DEC) - # │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT) - - cron: '0 7 * * *' # Every day at 07:00 UTC - -jobs: - dispatch_workflows: - runs-on: ubuntu-latest - steps: - - run: gh workflow run ci.yml --repo sunpy/sunkit-image --ref main - env: - GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c257c4c2..af3cbf06 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,12 +11,12 @@ repos: args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md)$" - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.1.4' + rev: 'v0.1.5' hooks: - id: ruff args: ['--fix'] - repo: https://github.com/psf/black - rev: 23.10.1 + rev: 23.11.0 hooks: - id: black exclude: ".*(.fits|.fts|.fit|.txt|.csv)$" @@ -45,7 +45,7 @@ repos: additional_dependencies: - tomli - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.6.1' + rev: 'v1.7.0' hooks: - id: mypy additional_dependencies: ['types-setuptools'] diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aab4eb6c..999702d3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,11 @@ +0.5.1 (2023-11-17) +================== + +Trivial/Internal Changes +------------------------ + +- Added the explicitly imported packages to the install requirements. (`#160 `__) + 0.5.0 (2023-08-10) ================== diff --git a/changelog/160.trivial.rst b/changelog/160.trivial.rst deleted file mode 100644 index 0508c624..00000000 --- a/changelog/160.trivial.rst +++ /dev/null @@ -1 +0,0 @@ -Added the explicitly imported packages to the install requirements. diff --git a/pyproject.toml b/pyproject.toml index b5a2d01a..76187d0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,70 +23,69 @@ dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" target-version = "py39" line-length = 120 exclude=[ - ".git,", - "__pycache__", - "build", - "tools/**", + ".git,", + "__pycache__", + "build", + "tools/**", ] select = [ - "E", - "F", - "W", - "UP", - "PT", - "RET", - "TID", - "PLE", - "NPY", - "RUF", - "PGH", - "PTH", - "BLE", - "FBT", - "B", - "A", - "COM", - "C4", - "T20", - "RSE", - "ERA", + "E", + "F", + "W", + "UP", + "PT", + "RET", + "TID", + "PLE", + "NPY", + "RUF", + "PGH", + "PTH", + "BLE", + "FBT", + "B", + "A", + "COM", + "C4", + "T20", + "RSE", + "ERA", ] fixable = [ - "E", - "F", - "W", - "UP", - "PT", - "RET", - "TID", - "PLE", - "NPY", - "RUF", - "PGH", - "PTH", - "BLE", - "FBT", - "B", - "A", - "COM", - "C4", - "T20", - "RSE", - "ERA", + "E", + "F", + "W", + "UP", + "PT", + "RET", + "TID", + "PLE", + "NPY", + "RUF", + "PGH", + "PTH", + "BLE", + "FBT", + "B", + "A", + "COM", + "C4", + "T20", + "RSE", + "ERA", ] extend-ignore = [ - "E501", # Line too long - # TODO: Fix in future - "E741", # Ambiguous variable name - "B006", # Do not use mutable data structures for argument defaults - "FBT002", # Boolean default value in function definition - + "E501", # Line too long + # TODO: Fix in future + "E741", # Ambiguous variable name + "B006", # Do not use mutable data structures for argument defaults + "FBT002", # Boolean default value in function definition ] [tool.ruff.per-file-ignores] "examples/*.py" = [ - "T201", # We need print in our examples - "PGH004", # Sometimes we need to use NOQA in examples + "T201", # We need print in our examples + "PGH004", # Sometimes we need to use NOQA in examples ] [tool.ruff.pydocstyle] diff --git a/setup.cfg b/setup.cfg index a4807ee3..c626d255 100644 --- a/setup.cfg +++ b/setup.cfg @@ -50,6 +50,8 @@ docs = beautifulsoup4 dask drms + # Remove next line when fixed in towncrier; see https://github.com/twisted/towncrier/issues/528 + importlib-resources<6 matplotlib sphinx sphinx_automodapi diff --git a/sunkit-dev-env.yml b/sunkit-dev-env.yml new file mode 100644 index 00000000..b6aa6c52 --- /dev/null +++ b/sunkit-dev-env.yml @@ -0,0 +1,45 @@ +channels: + - conda-forge + +dependencies: + # Required + - astropy + - numpy + - matplotlib + - scipy + - scikit-image + - sunpy + #- python # Commented out to avoid triggering an upgrade + + # Optional + - dask + + # Testing + - pytest-astropy + - pytest-mpl + - tox + - tox-conda + + # Documentation + - graphviz + - astroscrappy + - beautifulsoup4 + - dask + - drms + - matplotlib + - sphinx + - sphinx-automodapi + - sphinx-design + - sphinx-gallery + - zeep + + # Installation + - pip + - setuptools-scm + + # Development + - pre-commit + + - pip: + - sphinx-changelog + - sunpy-sphinx-theme