diff --git a/.circleci/config.yml b/.circleci/config.yml index 88b4b96c..45a8ffec 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,13 +2,13 @@ version: 2 jobs: twine-check: docker: - - image: circleci/python:3.8 + - image: cimg/python:3.12 steps: - checkout - - run: python setup.py sdist - - run: python -m pip install -U --user --force-reinstall twine + - run: python -m pip install -U --user build + - run: python -m build . --sdist + - run: python -m pip install -U --user twine - run: python -m twine check dist/* - workflows: version: 2 twine-check: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e36af018..2423841d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - test: + tests: needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: @@ -64,17 +64,45 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} docs: - needs: [test] + needs: [core] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: default_python: '3.9' submodules: false pytest: false + libraries: | + apt: + - pandoc + - graphviz envs: | - linux: py312-docs + conda: + needs: [core] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + lfs: true + - uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: ablog-test + environment-file: ablog-conda-test-env.yml + python-version: "3.12" + - name: Install ablog + shell: bash -el {0} + run: | + pip install --no-deps --no-build-isolation . + - name: Run test + shell: bash -el {0} + run: | + conda list + pytest -vvv -r a --pyargs ablog + make tests + extras: - needs: [test] + needs: [tests] uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main with: default_python: '3.9' @@ -86,6 +114,5 @@ jobs: - graphviz envs: | - linux: py312-sphinxdev - - linux: py312-conda secrets: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 04e6c440..e316179a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.4.0 + rev: 24.4.2 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks @@ -26,7 +26,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.3.7' + rev: 'v0.4.2' hooks: - id: ruff args: ['--fix'] diff --git a/ablog-conda-test-env.yml b/ablog-conda-test-env.yml new file mode 100644 index 00000000..df8fa7a1 --- /dev/null +++ b/ablog-conda-test-env.yml @@ -0,0 +1,22 @@ +channels: + - conda-forge + +dependencies: + - alabaster + - docutils + - feedgen + - graphviz + - invoke + - make + - myst-parser + - nbsphinx + - packaging + - pandoc + - pip + - pytest + - python-dateutil + - setuptools + - setuptools-scm + - sphinx + - sphinx-automodapi + - watchdog diff --git a/setup.cfg b/setup.cfg index d8f208b5..32ccaa93 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,6 +41,7 @@ docs = sphinx-automodapi tests = pytest + defusedxml>=0.8.0rc2 [options.entry_points] console_scripts = diff --git a/tox.ini b/tox.ini index 8c4c5326..cbffc463 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,6 @@ envlist = [testenv] allowlist_externals = - conda make git deps = @@ -17,8 +16,8 @@ commands = sphinx6: pip install -U "sphinx>=6.0,<7.0" sphinx7: pip install -U "sphinx>=7.0,<8.0" sphinx8: pip install -U "sphinx>=8.0,<9.0" - sphinxdev: pip install -U "git+https://repo.or.cz/docutils.git#egg=docutils&subdirectory=docutils" - sphinxdev: pip install -U "git+https://github.com/sphinx-doc/sphinx" + sphinxdev: pip install -U git+https://github.com/docutils/docutils.git + sphinxdev: pip install -U git+https://github.com/sphinx-doc/sphinx pip freeze --all --no-input pytest -vvv -r a --pyargs ablog make tests @@ -48,33 +47,3 @@ changedir = docs description = Invoke sphinx-build to check linkcheck works commands = sphinx-build --color -W --keep-going -b linkcheck . _build/html {posargs} - -# Requires tox-conda -[testenv:py{39,310,311}-conda] -extras = -deps = -conda_deps = - alabaster - docutils - feedgen - graphviz - invoke - make - myst-parser - nbsphinx - packaging - pandoc - pip - pytest - python-dateutil - setuptools - setuptools-scm - sphinx - sphinx-automodapi - watchdog -conda_channels = conda-forge -install_command = pip install --no-deps --no-build-isolation {opts} {packages} -commands = - conda list - pytest -vvv -r a --pyargs ablog - make tests