-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to pyproject.toml * update CI github actions * lint and format
- Loading branch information
Showing
21 changed files
with
331 additions
and
398 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
name: Upload Python Package | ||
name: Upload Python Package on PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
types: [published] | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/ipyfastscape | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/[email protected] | ||
- name: Set up Python | ||
uses: actions/[email protected] | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install setuptools setuptools-scm wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
python-version: "3.9" | ||
- name: Install publish dependencies | ||
run: python -m pip install build | ||
- name: Build package | ||
run: python -m build . -o py_dist | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
packages-dir: py_dist/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
name: Tests | ||
|
||
jobs: | ||
tests: | ||
name: Test Python (${{ matrix.os }} / ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
defaults: | ||
run: | ||
shell: bash -el {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "macos-latest"] #, "windows-latest"] | ||
python-version: ["3.9", "3.10", "3.11"] | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup micromamba | ||
uses: mamba-org/setup-micromamba@v1 | ||
with: | ||
environment-file: environment.yml | ||
cache-environment: true | ||
cache-downloads: false | ||
create-args: >- | ||
python=${{ matrix.python-version }} | ||
- name: Install fastscape | ||
run: | | ||
python -m pip install . -v | ||
- name: Run tests | ||
run: | | ||
pytest . -vv --color=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ __pycache__/ | |
build/ | ||
develop-eggs/ | ||
dist/ | ||
py_dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: ipyfastscape-dev | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python>=3.9 | ||
- xarray | ||
- ipygany>=0.5.0 | ||
- ipywidgets | ||
- pytest | ||
- pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
[build-system] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ | ||
"setuptools>=42", | ||
"setuptools-scm>=7", | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
include = [ | ||
"ipyfastscape", | ||
"ipyfastscape.*", | ||
] | ||
|
||
[tool.setuptools_scm] | ||
fallback_version = "9999" | ||
|
||
[project] | ||
name = "ipyfastscape" | ||
dynamic = ["version"] | ||
authors = [ | ||
{name = "Benoît Bovy", email = "[email protected]"}, | ||
] | ||
maintainers = [ | ||
{name = "IpyFastscape contributors"}, | ||
] | ||
license = {text = "BSD-3-Clause"} | ||
description = "Interactive widgets for topographic data analysis and modelling in Jupyter notebooks" | ||
keywords = ["fastscape", "xarray", "jupyter", "landscape", "topography"] | ||
readme = "README.md" | ||
classifiers = [ | ||
"Intended Audience :: Science/Research", | ||
"License :: OSI Approved :: BSD License", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"xarray", | ||
"ipywidgets", | ||
"ipygany >=0.5.0" | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = ["pytest"] | ||
|
||
[project.urls] | ||
Repository = "https://github.com/fastscape-lem/ipyfastscape" | ||
|
||
[tool.black] | ||
line-length = 100 | ||
|
||
[tool.ruff] | ||
# E402: module level import not at top of file | ||
# E501: line too long - let black worry about that | ||
# E731: do not assign a lambda expression, use a def | ||
ignore = [ | ||
"E402", | ||
"E501", | ||
"E731", | ||
] | ||
select = [ | ||
"F", # Pyflakes | ||
"E", # Pycodestyle | ||
"W", | ||
"I", # isort | ||
"UP", # Pyupgrade | ||
] | ||
exclude = [".eggs", "doc"] | ||
target-version = "py39" | ||
|
||
[tool.ruff.isort] | ||
known-first-party = ["ipyfastscape"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
from pkg_resources import DistributionNotFound, get_distribution | ||
from importlib.metadata import PackageNotFoundError, version | ||
|
||
from .common import AppLinker # noqa: F401 | ||
from .topoviz3d import TopoViz3d # noqa: F401 | ||
from .common import AppLinker | ||
from .topoviz3d import TopoViz3d | ||
|
||
try: | ||
__version__ = get_distribution(__name__).version | ||
except DistributionNotFound: # noqa: F401; pragma: no cover | ||
__version__ = version("ipyfastscape") | ||
except PackageNotFoundError: # noqa | ||
# package is not installed | ||
pass | ||
|
||
|
||
__all__ = ("AppLinker", "TopoViz3d", "__version__") |
Oops, something went wrong.