Skip to content

Commit

Permalink
Update infrastructure (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
timmens authored Feb 12, 2025
1 parent b3cd191 commit 25ababa
Show file tree
Hide file tree
Showing 32 changed files with 10,912 additions and 572 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
# Check for updates to GitHub Actions every week
interval: monthly
groups:
dependencies:
patterns:
- '*'
61 changes: 30 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
name: main
on:
push:
branches: [main]
branches:
- main
pull_request:
branches:
- '*'
Expand All @@ -12,42 +13,40 @@ concurrency:
cancel-in-progress: true
jobs:
run-tests:
name: Run tests for ${{ matrix.os }} on ${{ matrix.python-version }}
name: Run tests for ${{ matrix.os }} on ${{ matrix.environment }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11']
os:
- ubuntu-latest
- macos-13 # intel
- macos-latest # arm
- windows-latest
environment:
- py310
- py311
- py312
- py313
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
- uses: actions/checkout@v4
- uses: prefix-dev/setup-pixi@v0.8.2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install core dependencies.
shell: bash -l {0}
run: conda install -c conda-forge tox-conda
- name: Run pytest.
shell: bash -l {0}
run: tox -e pytest -- -m "not slow" --cov-report=xml --cov=./
pixi-version: v0.41.1
cache: true
cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
frozen: true
environments: ${{ matrix.environment }}
- name: Run all tests except Linux and py313.
if: runner.os != 'Linux' || matrix.environment != 'py313'
shell: bash -el {0}
run: pixi run -e ${{ matrix.environment }} tests
- name: Run tests with codecov on Linux and py313.
if: runner.os == 'Linux' && matrix.environment == 'py313'
shell: bash -el {0}
run: pixi run -e ${{ matrix.environment }} tests-with-cov
- name: Upload coverage report.
if: runner.os == 'Linux' && matrix.python-version == '3.9'
uses: codecov/codecov-action@v1
if: runner.os == 'Linux' && matrix.environment == 'py313'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
docs:
name: Run documentation.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: 3.9
- name: Install core dependencies.
shell: bash -l {0}
run: conda install -c conda-forge tox-conda
- name: Build docs
shell: bash -l {0}
run: tox -e sphinx
10 changes: 5 additions & 5 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ jobs:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.8
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.12'
- name: Install pypa/build
run: >-
python -m
Expand All @@ -26,6 +26,6 @@ jobs:
--outdir dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ share/python-wheels/
*.egg
MANIFEST

# pixi
.pixi/

# Linter / formatter
.ruff_cache

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down
40 changes: 33 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ repos:
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=10000]
args:
- --maxkb=10000
- id: check-case-conflict
- id: check-merge-conflict
- id: check-vcs-permalinks
Expand All @@ -22,13 +23,20 @@ repos:
- id: debug-statements
- id: end-of-file-fixer
- id: fix-byte-order-marker
types: [text]
types:
- text
- id: forbid-submodules
- id: mixed-line-ending
args: [--fix=lf]
args:
- --fix=lf
description: Forces to replace line ending by the UNIX 'lf' character.
- id: name-tests-test
args:
- --pytest-test-first
- id: no-commit-to-branch
args: [--branch, main]
args:
- --branch
- main
- id: trailing-whitespace
- id: check-ast
- id: check-docstring-first
Expand All @@ -37,15 +45,33 @@ repos:
hooks:
- id: yamllint
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
rev: v0.9.6
hooks:
# Run the linter.
- id: ruff
types_or: [python, jupyter]
types_or:
- python
- pyi
- jupyter
args:
- --fix
# Run the formatter.
- id: ruff-format
types_or: [python, jupyter]
types_or:
- python
- pyi
- jupyter
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.22
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-gfm-alerts
- mdformat-ruff
args:
- --wrap
- '88'
files: (README\.md)
ci:
autoupdate_schedule: monthly
10 changes: 7 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
version: 2
build:
image: latest
python:
version: 3.8
os: ubuntu-22.04
tools:
python: mambaforge-4.10
conda:
environment: docs/rtd_environment.yml
sphinx:
builder: html
configuration: docs/source/conf.py
fail_on_warning: false
36 changes: 36 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
yaml-files:
- '*.yaml'
- '*.yml'
- .yamllint
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start:
level: warning
empty-lines: enable
empty-values: disable
float-values: disable
hyphens: enable
indentation: {spaces: 2}
key-duplicates: enable
key-ordering: disable
line-length:
max: 88
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: false
new-line-at-end-of-file: enable
new-lines:
type: unix
octal-values: disable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
35 changes: 17 additions & 18 deletions CHANGES.rst → CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,36 @@
Changes
=======
# Changes

This is a record of all past dags releases and what went into them in reverse
chronological order. We follow `semantic versioning <https://semver.org/>`_ and all
releases are available on `Anaconda.org
<https://anaconda.org/OpenSourceEconomics/dags>`_.
chronological order. We follow [semantic versioning](https://semver.org/) and all
releases are available on [conda-forge](https://anaconda.org/conda-forge/dags).

## 0.???

0.2.2 - 2022-xx-xx
------------------
- :gh:`19` Update infrastructure, move to Pixi (:ghuser:`timmens`).
- :gh:`17` Add possibility to use namespaces (:ghuser:`lars-reimann`, :ghuser:`MImmesberger`).

## 0.2.3

- :gh:`9` Add function to return the DAG. Check for cycles in DAG.
(:ghuser:`ChristianZimpelmann`)

## 0.2.2

- :gh:`5` Updates examples used in tests (:ghuser:`janosg`)
- :gh:`7` improves the examples in the test cases.
- :gh:`10` turns ``targets`` into an optional argument. All variables in the DAG are
returned by default.
- :gh:`9` Add function to return the DAG. Check for cycles in DAG.
(:ghuser:`ChristianZimpelmann`)
returned by default. (:ghuser:`tobiasraabe`)

0.2.1 - 2022-03-29
------------------
## 0.2.1

- :gh:`4` Small fix in treatment of partialled arguments (:ghuser:`janosg`)


0.2.0 - 2022-03-25
------------------
## 0.2.0

- :gh:`3` ignores partialled arguments when reading signatures (:ghuser:`janosg`)
- :gh:`2` enforces signatures of generated functions, adds support for more output
types and adds decorators to work with signatures (:ghuser:`janosg`)


0.1.0 - 2022-03-08
------------------
## 0.1.0

- :gh:`1` releases the initial version of dags.
11 changes: 0 additions & 11 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 25ababa

Please sign in to comment.