Skip to content

Commit

Permalink
pyproject.toml (#103)
Browse files Browse the repository at this point in the history
* pyproject.toml files the pypi version and the poetry version

* replace the setup.py by a pyproject.toml

* replace the requirements.txt and the requirements-dev.txt file in the workflow by pip install

* update notebooks

* remove the requirements.txt

* remove the requirements.txt

* remove the requirements-dev.txt from the conda-deployment.yml workflow

* fix testing jupyter notebooks

* link  jupyter kernel to the conda environment

* use shell: bash -el {0} in the steps

* remove the jupyter notebook tests from the conda-deployment.yml workflow

* separate jupyter notebooks to a separate workflow

* correct workflow

* return the workflow dependency

* correct the trigger key

* add branched to the workflow_run

* merge the .flake8 config file to the pyproject.toml

* merge the pytest.ini file to the pytroject.toml

* use workflow_call instead of workflow_run

* add fix to the conda-deployment.yml

* add fix to the conda-deployment.yml

* add fix 2

* use the entire path to the workflow

* update path to reusable workflow

* use uses instead of steps

* remove the secret: inheret

* fix initialization issue

* connect the notbook testing with the pypi-deployment

* fix issue

* use caching

* unify path

* return notebook tests to conda-deployment.yml workflow

* return notebook tests to conda-deployment.yml workflow

* install the package in normal mode

* remove the --no-deps in the dev installation

* update examples

* move the package to src root dir

* add include dir in the pyproject.toml

* remove unnecessary pass statement

* change the where statement in the pyproject.toml

* Revert "change the where statement in the pyproject.toml"

This reverts commit 06b692c.

* update conda-workflow

* add package-dir

* add install statement in the test step

* add install statement in the test step

* remove the package-dir from pytproject.toml

* use python -m build instead of setup.py install

* remove the setup.py and use new command for the pyproject.toml

* remove poetry file
  • Loading branch information
MAfarrag authored Dec 8, 2024
1 parent dca8f92 commit e840920
Show file tree
Hide file tree
Showing 34 changed files with 1,113 additions and 10,216 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

17 changes: 13 additions & 4 deletions .github/workflows/conda-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ jobs:
environment-file: environment.yml
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channels: conda-forge
channel-priority: true
show-channel-urls: true

- name: Install dev-dependencies
run: |
python -m pip install -r requirements-dev.txt
pip install .[dev]
- name: Generate coverage report
shell: bash -el {0}
Expand All @@ -38,6 +38,7 @@ jobs:
conda list
conda config --show-sources
conda config --show
pip install .
pytest -sv -m "not plot"
Optional-packages:
Expand All @@ -60,13 +61,13 @@ jobs:
environment-file: environment-optional-packages.yml
activate-environment: test
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channels: conda-forge
channel-priority: true
show-channel-urls: true

- name: Install dev-dependencies
run: |
python -m pip install -r requirements-dev.txt
pip install .[dev]
- name: Generate coverage report
shell: bash -el {0}
Expand All @@ -76,4 +77,12 @@ jobs:
conda list
conda config --show-sources
conda config --show
pip install .
pytest -sv
- name: test Jupyter notebook
shell: bash -el {0}
run: |
conda activate test
pip install .
pytest --nbval -k ".ipynb"
40 changes: 0 additions & 40 deletions .github/workflows/jupyter-notebooks-examples.yml

This file was deleted.

9 changes: 4 additions & 5 deletions .github/workflows/pypi-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt -r requirements-dev.txt
python setup.py install
pip install .[dev]
- name: Generate coverage report
run: |
Expand Down Expand Up @@ -73,12 +72,12 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements-optional-packages.txt -r requirements-dev.txt
python setup.py install
pip install .[dev,viz]
- name: Generate coverage report
- name: Run Tests
run: |
python -m pytest -v --cov=pyramids --cov-report=xml
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

3 changes: 2 additions & 1 deletion .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ jobs:
TWINE_USERNAME: ${{ secrets.PYPI_USERS }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
pip install build
python -m build
twine upload dist/*
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
name: "[py - check] validate yaml"
Expand Down Expand Up @@ -58,19 +58,19 @@ repos:
files: ^pyramids/

- repo: https://github.com/pycqa/flake8
rev: 7.1.0
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: [Flake8-pyproject]
name: "[py - check] flake8"
# language_version: python3.9
exclude: ^(examples/|tests/)

#- repo: https://github.com/psf/black
# rev: 22.8.0
# hooks:
# - id: black
- repo: https://github.com/ambv/black
rev: 24.4.2
rev: 24.10.0
hooks:
- id: black
name: "[py - format] black"
Expand Down
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,10 @@ is deprecated.
* update the miniconda workflow in ci.
* update gdal to 3.10 and update the DataSource to Dataset in the `FeatureCollection.file_name`.
* add `libgdal-netcdf` and `libgdal-hdf4` to the conda dependencies.

0.7.2 (2024-12-**)
------------------
Dev
"""
* replace the setup.py with pyproject.toml
Loading

0 comments on commit e840920

Please sign in to comment.