Skip to content

Commit

Permalink
updated package before going to ipywidgets
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlib committed Mar 4, 2025
1 parent 14549eb commit 05623fd
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 51 deletions.
3 changes: 2 additions & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/ecmwf-projects/cookiecutter-conda-package",
"commit": "7eaa7e75c7e2ce85eee1716fc9197f22d3500743",
"commit": "1d33c0f487335c5086797607a764cded25b7899f",
"checkout": null,
"context": {
"cookiecutter": {
Expand All @@ -11,6 +11,7 @@
"copyright_year": "2023",
"mypy_strict": "False",
"integration_tests": "True",
"pypi": true,
"_template": "https://github.com/ecmwf-projects/cookiecutter-conda-package"
}
},
Expand Down
44 changes: 22 additions & 22 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1

combine-environments:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install conda-merge
Expand All @@ -44,7 +44,7 @@ jobs:
for SUFFIX in ci integration; do
conda-merge ci/environment-$SUFFIX.yml environment.yml > ci/combined-environment-$SUFFIX.yml || exit
done
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: combined-environments
path: ci/combined-environment-*.yml
Expand All @@ -55,18 +55,18 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.11']

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
Expand All @@ -88,22 +88,22 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.10
python=3.11
- name: Install package
run: |
python -m pip install --no-deps -e .
Expand All @@ -117,22 +117,22 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/combined-environment-ci.yml
environment-name: DEVELOP
cache-environment: true
cache-environment-key: environment-${{ steps.date.outputs.date }}
cache-downloads-key: downloads-${{ steps.date.outputs.date }}
create-args: >-
python=3.10
python=3.11
- name: Install package
run: |
python -m pip install --no-deps -e .
Expand All @@ -149,19 +149,19 @@ jobs:
strategy:
matrix:
include:
- python-version: '3.10'
- python-version: '3.11'
extra: -integration

steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: combined-environments
path: ci
- name: Get current date
id: date
run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}"
- uses: mamba-org/setup-micromamba@v1
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: ci/combined-environment${{ matrix.extra }}.yml
environment-name: DEVELOP${{ matrix.extra }}
Expand Down Expand Up @@ -189,9 +189,9 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
- name: Install package
run: |
python -m pip install --upgrade pip
Expand All @@ -206,7 +206,7 @@ jobs:
python -m twine check --strict * || exit
python -c "import openptv_python" || exit
cd ..
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: distribution
path: dist
Expand All @@ -215,7 +215,7 @@ jobs:
runs-on: ubuntu-latest
needs: distribution
if: |
always() &&
always() && true &&
needs.distribution.result == 'success' &&
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags')
Expand All @@ -226,10 +226,10 @@ jobs:
id-token: write # IMPORTANT: this permission is mandatory for trusted publish

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: distribution
path: dist
- uses: pypa/gh-action-pypi-publish@v1.8.10
- uses: pypa/gh-action-pypi-publish@v1.12.4
with:
verbose: true
13 changes: 1 addition & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
version.py

# Sphinx automatic generation of API
docs/README.md
docs/_api/

# Combined environments
Expand Down Expand Up @@ -468,16 +469,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

<<<<<<< ours
# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm
tests/testing_fodder/track/img/*
tests/testing_fodder/track/res/*
=======
# End of https://www.toptal.com/developers/gitignore/api/python,jupyternotebooks,vim,visualstudiocode,pycharm,emacs,linux,macos,windows
>>>>>>> theirs
tests/testing_fodder/test_cavity/*
tests/testing_fodder/track/newpart/*
tests/testing_fodder/burgers/*
tests/testing_fodder/test_0042_targets
tests/testing_folder/round_trip.%04d0001_targets
*.prof
2 changes: 1 addition & 1 deletion .pre-commit-config-cruft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/cruft/cruft
rev: 2.15.0
rev: 2.16.0
hooks:
- id: cruft
entry: cruft update -y
Expand Down
12 changes: 7 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -17,21 +17,23 @@ repos:
- id: blackdoc
additional_dependencies: [black==23.11.0]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.5
rev: v0.9.9
hooks:
- id: ruff
args: [--fix, --show-fixes]
- id: ruff-format
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.22
hooks:
- id: mdformat
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
rev: v2.14.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --preserve-quotes]
- id: pretty-format-toml
args: [--autofix]
- repo: https://github.com/gitleaks/gitleaks
rev: v8.18.0
rev: v8.24.0
hooks:
- id: gitleaks
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /src/openptv-python

COPY environment.yml /src/openptv-python/

RUN conda install -c conda-forge gcc python=3.10 \
RUN conda install -c conda-forge gcc python=3.11 \
&& conda env update -n base -f environment.yml

COPY . /src/openptv-python
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ template-update:
pre-commit run --all-files cruft -c .pre-commit-config-cruft.yaml

docs-build:
cd docs && rm -fr _api && make clean && make html
cp README.md docs/. && cd docs && rm -fr _api && make clean && make html

# DO NOT EDIT ABOVE THIS LINE, ADD COMMANDS BELOW
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ this structure
For the best experience create a new conda environment (e.g. DEVELOP) with Python 3.10:

```
conda create -n openptvpy -c conda-forge python=3.10
conda activate openptvpy
conda create -n openptv-python -c conda-forge python=3.11
conda activate openptv-python
```

Before pushing to GitHub, run the following commands:
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@
autodoc_typehints = "none"

# autoapi configuration
autoapi_add_toctree_entry = False
autoapi_dirs = ["../openptv_python"]
autoapi_ignore = ["*/version.py"]
autoapi_member_order = "groupwise"
autoapi_options = [
"members",
"inherited-members",
Expand Down
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Python version of the OpenPTV library.
:caption: 'Contents:'
:maxdepth: 2
README.md
API Reference <_api/openptv_python/index>
```

Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[build-system]
requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64", "setuptools_scm>=8"]

[project]
classifiers = [
Expand All @@ -9,7 +10,6 @@ classifiers = [
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering"
]
Expand All @@ -26,13 +26,15 @@ branch = true
strict = false

[tool.ruff]
# Same as Black.
indent-width = 4
line-length = 88

[tool.ruff.lint]
ignore = [
# pydocstyle: Missing Docstrings
"D1"
]
# Same as Black.
indent-width = 4
line-length = 88
select = [
# pyflakes
"F",
Expand All @@ -48,13 +50,14 @@ select = [
[tool.ruff.lint.pycodestyle]
max-line-length = 110

[tool.ruff.pydocstyle]
[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.setuptools]
packages = ["openptv_python"]

[tool.setuptools_scm]
fallback_version = "999"
write_to = "openptv_python/version.py"
write_to_template = '''
# Do not change! Do not track in version control!
Expand Down

0 comments on commit 05623fd

Please sign in to comment.