From 45e60a4ab3c6e6f8e2bf110760df674bc256a7c3 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 10:04:06 -0400 Subject: [PATCH 01/13] Create CI GitHub workflow --- .github/workflows/ci_tests.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci_tests.yml diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml new file mode 100644 index 0000000..1813449 --- /dev/null +++ b/.github/workflows/ci_tests.yml @@ -0,0 +1,33 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: CI Tests + +on: + push: + branches: [ "main" ] + pull_request: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest tox + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Test with Tox + run: | + tox From 93d81297c27954704fb50f8b5f4e9a64b935b884 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 10:06:15 -0400 Subject: [PATCH 02/13] retire CircleCi --- .circleci/config.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 48e499c..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2.1 - -orbs: - python: circleci/python@2.0.3 - -workflows: - pytest-all: - jobs: - - build-and-test - -jobs: - build-and-test: - resource_class: medium+ - docker: - - image: jupyter/scipy-notebook:python-3.10 - steps: - - checkout - - run: - name: Install tox - command: pip install tox==3.25.1 - - run: - name: Run Tests - command: tox \ No newline at end of file From 12a7e36e2e71c05d50794d90443dd08d4c22b2f5 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 10:15:44 -0400 Subject: [PATCH 03/13] add PhotUtils 1.5.0 to requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ba1de2b..e2efde8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ notebook regions # Dependencies -photutils>=1.1.0 +photutils==1.5.0 ipywidgets # Docs From 5a63e373712c44aeda1636e6e86b4af421918f79 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 10:46:03 -0400 Subject: [PATCH 04/13] update tox and workflow --- .github/workflows/ci_tests.yml | 29 ++++++++++++++++++----------- tox.ini | 25 +++++-------------------- 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 1813449..0a7eb43 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -5,29 +5,36 @@ name: CI Tests on: push: - branches: [ "main" ] + branches: + - main + tags: + - '*' pull_request: jobs: - build: - - runs-on: ubuntu-latest + tests: + name: ${{ matrix.prefix }} ${{ matrix.os }}, ${{ matrix.tox_env }} + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.allow_failure }} strategy: - fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11"] - + include: + - os: ubuntu-latest + python: '3.9' + tox_env: 'pypython3.10-test-alldeps' + allow_failure: false + prefix: '' steps: - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 with: - python-version: ${{ matrix.python-version }} + python-version: ${{ matrix.python }} - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install flake8 pytest tox + python -m pip install tox if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with Tox run: | - tox + tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }} diff --git a/tox.ini b/tox.ini index 8cc8abf..5485686 100644 --- a/tox.ini +++ b/tox.ini @@ -2,18 +2,21 @@ envlist = py{python3.10}-test{-alldeps} py{python3.10}-test-numpy{122} - py{python3.10}-test-astropy{503} + py{python3.10}-test-astropy{50} build_docs linkcheck -# codestyle # Disabled until cleanup + requires = setuptools >= 61.0.0 pip >= 22.0.0 + isolated_build = true + indexserver = NIGHTLY = https://pypi.anaconda.org/scipy-wheels-nightly/simple [testenv] + # Suppress display of matplotlib plots generated during docs build setenv = MPLBACKEND=agg @@ -35,9 +38,6 @@ changedir = .tmp/{envname} description = run tests alldeps: with all optional dependencies - devdeps: with the latest developer version of key dependencies - oldestdeps: with the oldest supported version of key dependencies - cov: and test coverage numpy122: with numpy 1.22.* astropy50: with astropy 5.0.* astropylts: with the latest astropy LTS @@ -47,12 +47,7 @@ deps = -r{toxinidir}/requirements.txt cov: coverage numpy122: numpy==1.22.* - astropy50: astropy==5.0.* - astropylts: astropy==5.0.* - - devdeps: :NIGHTLY:numpy - devdeps: git+https://github.com/astropy/astropy.git#egg=astropy # The following indicates which extras_require from setup.cfg will be installed extras = @@ -61,9 +56,6 @@ extras = commands = pip freeze - !cov: pytest --pyargs petrofit {toxinidir}/docs {posargs} - cov: pytest --pyargs petrofit {toxinidir}/docs --cov petrofit --cov-config={toxinidir}/setup.cfg {posargs} - cov: coverage xml -o {toxinidir}/coverage.xml [testenv:build_docs] changedir = docs @@ -80,10 +72,3 @@ extras = docs commands = pip freeze sphinx-build -W -b linkcheck . _build/html - -[testenv:codestyle] -skip_install = true -changedir = . -description = check code style, e.g. with flake8 -deps = flake8 -commands = flake8 petrofit --count --max-line-length=100 From 534754f820c8a7bdf5b8b74a580320b76934b834 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 10:57:13 -0400 Subject: [PATCH 05/13] update tox.ini to add pytest --- .github/workflows/ci_tests.yml | 5 ++--- tox.ini | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 0a7eb43..76f5233 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -20,8 +20,8 @@ jobs: matrix: include: - os: ubuntu-latest - python: '3.9' - tox_env: 'pypython3.10-test-alldeps' + python: '3.10' + tox_env: 'py310-test-alldeps' allow_failure: false prefix: '' steps: @@ -34,7 +34,6 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install tox - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Test with Tox run: | tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }} diff --git a/tox.ini b/tox.ini index 5485686..7d5744f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] envlist = - py{python3.10}-test{-alldeps} - py{python3.10}-test-numpy{122} - py{python3.10}-test-astropy{50} + py{310}-test{-alldeps} + py{310}-test-numpy{122} + py{310}-test-astropy{50} build_docs linkcheck @@ -45,7 +45,6 @@ description = # The following provides some specific pinnings for key packages deps = -r{toxinidir}/requirements.txt - cov: coverage numpy122: numpy==1.22.* astropy50: astropy==5.0.* @@ -56,6 +55,7 @@ extras = commands = pip freeze + pytest --pyargs petrofit {toxinidir}/docs [testenv:build_docs] changedir = docs From b00b2d8c49f2c7a3f11181960d6f0f5779773fe6 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 12:26:57 -0400 Subject: [PATCH 06/13] add all tox tests --- .github/workflows/ci_tests.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 76f5233..e269f98 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -24,6 +24,25 @@ jobs: tox_env: 'py310-test-alldeps' allow_failure: false prefix: '' + + - os: ubuntu-latest + python: '3.10' + tox_env: 'py310-test-astropy50' + allow_failure: false + prefix: '' + + - os: ubuntu-latest + python: '3.10' + tox_env: 'py310-test-numpy122' + allow_failure: false + prefix: '' + + - os: ubuntu-latest + python: '3.10' + tox_env: 'build_docs' + allow_failure: false + prefix: '' + steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python }} @@ -36,4 +55,4 @@ jobs: python -m pip install tox - name: Test with Tox run: | - tox -e ${{ matrix.tox_env }} -- ${{ matrix.toxposargs }} + tox -e ${{ matrix.tox_env }} From b5acd7fa0bbfbe4654cb752655103c4704b65fa2 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 12:30:54 -0400 Subject: [PATCH 07/13] add pandoc to requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index e2efde8..f1666a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,7 @@ ipywidgets sphinx docutils nbsphinx +pandoc # Other tox From e793d63dba4103501801351ad602ed61774df523 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 12:34:42 -0400 Subject: [PATCH 08/13] add nbconvert to requirements --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f1666a3..417f34e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,7 +16,7 @@ ipywidgets sphinx docutils nbsphinx -pandoc +nbconvert # Other tox From d730bcc143ee72469f233904103d7351270fcd5f Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 12:50:50 -0400 Subject: [PATCH 09/13] add pandoc to ci --- .github/workflows/ci_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index e269f98..b150ecd 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -49,6 +49,9 @@ jobs: uses: actions/setup-python@v3 with: python-version: ${{ matrix.python }} + - name: Install Pandoc for build_docs + if: matrix.tox_env == 'build_docs' + run: sudo apt-get install -y pandoc - name: Install dependencies run: | python -m pip install --upgrade pip From 9a7b46e4986590eee02b81077480a7c4c32a7816 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 12:51:27 -0400 Subject: [PATCH 10/13] fix indent --- .github/workflows/ci_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index b150ecd..9d5df13 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -50,8 +50,8 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install Pandoc for build_docs - if: matrix.tox_env == 'build_docs' - run: sudo apt-get install -y pandoc + if: matrix.tox_env == 'build_docs' + run: sudo apt-get install -y pandoc - name: Install dependencies run: | python -m pip install --upgrade pip From 4597796379fb669ff449768b5377e50e8b648e12 Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 13:06:05 -0400 Subject: [PATCH 11/13] try to fix colors --- .github/workflows/ci_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 9d5df13..ca9a831 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -58,4 +58,7 @@ jobs: python -m pip install tox - name: Test with Tox run: | + export PY_COLORS=1 tox -e ${{ matrix.tox_env }} + env: + PY_COLORS: '1' From 4c650ab862fdc5e02efeb3acf5f39de1a74962bc Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 13:21:38 -0400 Subject: [PATCH 12/13] remove CircleCI badge --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 7f4f976..ef75b06 100644 --- a/README.rst +++ b/README.rst @@ -4,7 +4,7 @@ PetroFit -------- -|circleci tag| |rtd tag| |PyPI tag| |AJ tag| |astropy tag| |photutils tag| +|rtd tag| |PyPI tag| |AJ tag| |astropy tag| |photutils tag| PetroFit is a package for calculating Petrosian properties, such as radii and concentration indices, as well as fitting galaxy light profiles. In particular, PetroFit includes tools for performing accurate photometry, segmentations, From 1c74e7ebec5e751f11b6132e9e527aacf4435aee Mon Sep 17 00:00:00 2001 From: robelgeda Date: Sun, 6 Aug 2023 13:25:45 -0400 Subject: [PATCH 13/13] chage name of workflow --- .github/workflows/ci_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index ca9a831..36db52c 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python -name: CI Tests +name: ci_tests on: push: