Skip to content

Commit

Permalink
Merge pull request #189 from zonca/hatchling
Browse files Browse the repository at this point in the history
switch from setuptools to hatch and switch Github Actions to conda
  • Loading branch information
zonca committed Aug 31, 2024
2 parents b79e0b5 + 8dc8ea6 commit c0bed53
Show file tree
Hide file tree
Showing 74 changed files with 554 additions and 1,626 deletions.
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
78 changes: 22 additions & 56 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,72 +22,38 @@ jobs:
strategy:
matrix:
include:
- name: Code style checks
os: ubuntu-22.04
python: 3.x
toxenv: codestyle

- name: Python 3.9 with minimal dependencies
- name: Python 3.9
os: ubuntu-22.04
python: 3.9
toxenv: py39-test

- name: Python 3.11 with all optional dependencies and coverage checking
- name: Python 3.12
os: ubuntu-22.04
python: 3.11
toxenv: py311-test-alldeps-cov

# - name: OS X - Python 3.8
# os: macos-10.15
# python: 3.8
# toxenv: py38-test

# - name: Python 3.7 with oldest supported version of all dependencies
# os: ubuntu-16.04
# python: 3.7
# toxenv: py37-test-oldestdeps

# - name: Python 3.8 with latest dev versions of key dependencies
# os: ubuntu-latest
# python: 3.8
# toxenv: py38-test-devdeps

# - name: Test building of Sphinx docs
# os: ubuntu-latest
# python: 3.x
# toxenv: build_docs
python: 3.12

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install required system packages
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo sed -i -e 's/azure.archive.ubuntu.com/us.archive.ubuntu.com/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -o Acquire::Retries=3 graphviz texlive-latex-extra dvipng libopenmpi-dev openmpi-bin pandoc libhdf5-dev netcdf-bin libnetcdf-dev
fi
shell: bash
- name: Set up python ${{ matrix.python }} on ${{ matrix.os }}
uses: actions/setup-python@v5
- uses: mamba-org/setup-micromamba@v1
with:
python-version: ${{ matrix.python }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox psutil codecov
- name: Test with tox
environment-name: test-env
create-args: >-
python=${{ matrix.python }}
netcdf4
init-shell: >-
bash
cache-environment: true
post-cleanup: 'all'
- name: Install package
run: pip install .[test]
shell: bash -el {0}
- name: Run Pytest
run: |
tox -e ${{ matrix.toxenv }}
- name: MPI test
if: contains(matrix.toxenv, 'alldeps')
run: |
mpirun -np 2 --oversubscribe .tox/${{ matrix.toxenv}}/bin/python -m pytest pysm3/tests/test_read_map_mpi.py;
# This is an example of how to upload coverage to codecov
# - name: Upload coverage to codecov
# if: "contains(matrix.toxenv, '-cov')"
# uses: codecov/codecov-action@v1
# with:
# file: ./coverage.xml
pytest -v
shell: bash -el {0}

# - name: MPI test
# run: |
# mpirun -np 2 --oversubscribe .tox/${{ matrix.toxenv}}/bin/python -m pytest pysm3/tests/test_read_map_mpi.py;
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ pip-wheel-metadata/
*.log
*.out
obsolete
src/pysm3/_version.py
pysm.code-workspace
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.6.0"
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: mixed-line-ending
- id: name-tests-test
args: ["--pytest-test-first"]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.6.1"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
3.4.1 (unreleased)
==================
- Updated `pixell` from 0.17.3 to 0.26.0 https://github.com/galsci/pysm/pull/183
- Initial implementation of a point source catalog component emission https://github.com/galsci/pysm/pull/187
- Switch the build system to Hatch https://github.com/galsci/pysm/pull/189

3.4.0 (2023-12-11)
==================
Expand Down
File renamed without changes.
Loading

0 comments on commit c0bed53

Please sign in to comment.