Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and upload to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
test:
uses: ./.github/workflows/test.yml

deploy:
needs: test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build guidata babel

- name: Compile translations
run: |
python -m guidata.utils.translations compile --name moduletester --directory .

- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev]

- name: Lint with Ruff
run: ruff check --output-format=github moduletester

- name: Test with pytest
run: pytest -v --tb=long
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
winpython.env
.spyderproject
doc.zip
Expand All @@ -13,6 +14,10 @@ doc/install_requires.txt
doc/extras_require-dev.txt
doc/extras_require-doc.txt
*.bak
*.moduletester
tmp/*
rtv/*
dtv/*

# Created by https://www.gitignore.io/api/python

Expand All @@ -28,6 +33,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
.venv/
build/
_build/
develop-eggs/
Expand Down Expand Up @@ -79,3 +85,9 @@ cdl/data/doc/
target/

/.spyproject

# document generation
*/rtv/*
*/dtv/*
moduletester/data/icons/*.py
*codra*.docx
9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.2
hooks:
# Run the linter.
- id: ruff-check
args: [ --fix ]
# Run the formatter.
- id: ruff-format
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
],
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter"
},
Expand All @@ -41,4 +41,12 @@
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"svg.preview.background": "editor",
"python-envs.pythonProjects": [
{
"path": ".",
"envManager": "ms-python.python:venv",
"packageManager": "ms-python.python:pip"
}
],
}
Loading
Loading