Skip to content

Commit

Permalink
Merge pull request #181 from robelgeda/github_workflow
Browse files Browse the repository at this point in the history
Remove CircleCI and add GitHub CI workflow
  • Loading branch information
robelgeda committed Aug 6, 2023
2 parents 1b69c59 + 1c74e7e commit a8ff7bc
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 48 deletions.
23 changes: 0 additions & 23 deletions .circleci/config.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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
tags:
- '*'
pull_request:

jobs:
tests:
name: ${{ matrix.prefix }} ${{ matrix.os }}, ${{ matrix.tox_env }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.allow_failure }}
strategy:
matrix:
include:
- os: ubuntu-latest
python: '3.10'
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 }}
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
python -m pip install tox
- name: Test with Tox
run: |
export PY_COLORS=1
tox -e ${{ matrix.tox_env }}
env:
PY_COLORS: '1'
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ notebook
regions

# Dependencies
photutils>=1.1.0
photutils==1.5.0
ipywidgets

# Docs
sphinx
docutils
nbsphinx
nbconvert

# Other
tox
Expand Down
31 changes: 8 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[tox]
envlist =
py{python3.10}-test{-alldeps}
py{python3.10}-test-numpy{122}
py{python3.10}-test-astropy{503}
py{310}-test{-alldeps}
py{310}-test-numpy{122}
py{310}-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

Expand All @@ -35,24 +38,15 @@ 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

# The following provides some specific pinnings for key packages
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 =
Expand All @@ -61,9 +55,7 @@ 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
pytest --pyargs petrofit {toxinidir}/docs

[testenv:build_docs]
changedir = docs
Expand All @@ -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

0 comments on commit a8ff7bc

Please sign in to comment.