Skip to content

Commit

Permalink
Add publish workflow, install prettier hook and run it
Browse files Browse the repository at this point in the history
  • Loading branch information
dalonsoa committed Dec 12, 2023
1 parent 052f7f7 commit b26fac5
Show file tree
Hide file tree
Showing 21 changed files with 798 additions and 250 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
max_line_length = 88

[*.md]
indent_size = 2

[*.yaml]
indent_size = 2

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
24 changes: 12 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest]
python-version: [ "3.9", "3.10", "3.11" ]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install and build
run: |
python -m pip install -r requirements-dev.txt
python -m pip install .
- name: Install and build
run: |
python -m pip install -r requirements-dev.txt
python -m pip install .
- name: Run tests
run: python -m pytest
- name: Run tests
run: python -m pytest
64 changes: 64 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on: [release]

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

build-wheel:
needs: test
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: |
python -m pip install --upgrade build
python -m build
- uses: actions/upload-artifact@v3
with:
path: dist/wsimod

publish-TestPyPI:
needs: build-wheel
name: Publish WSIMOD to TestPyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Download sdist artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Display structure of downloaded files
run: ls -R dist

- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true

publish-PyPI:
needs: publish-TestPyPI
name: Publish WSIMOD to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write

steps:
- name: Download sdist artifact
uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- name: Display structure of downloaded files
run: ls -R dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.3'
rev: "v0.1.3"
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -21,4 +21,8 @@ repos:
rev: v0.37.0
hooks:
- id: markdownlint
args: ["--disable", "MD013", "MD033", "--"]
args: ["--disable", "MD013", "MD033", "--"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0
hooks:
- id: prettier
12 changes: 6 additions & 6 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"description": "Release following the JOSS review process",
"description": "Release following the JOSS review process",
"license": {
"id": "bsd-3-clause",
"title": "BSD 3-Clause License",
"url": "https://opensource.org/licenses/BSD-3-Clause"
},
"title": "Water Systems Integrated Modelling framework, WSIMOD: A Python package for integrated modelling of water quality and quantity across the water cycle",
"version": "0.3_joss_reviewed",
"upload_type": "software",
"publication_date": "2023-02-21",
},
"title": "Water Systems Integrated Modelling framework, WSIMOD: A Python package for integrated modelling of water quality and quantity across the water cycle",
"version": "0.3_joss_reviewed",
"upload_type": "software",
"publication_date": "2023-02-21",
"creators": [
{
"name": "Dobson, Barnaby",
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ with arcs, and create simulations.

You can access our documentation below or at [https://imperialcollegelondon.github.io/wsi](https://imperialcollegelondon.github.io/wsi).

*Requires*: Python 3 (tested on versions >=3.7), [tqdm](https://tqdm.github.io/), [PyYAML](https://pyyaml.org/), [dill](https://dill.readthedocs.io/en/latest/)
_Requires_: Python 3 (tested on versions >=3.7), [tqdm](https://tqdm.github.io/), [PyYAML](https://pyyaml.org/), [dill](https://dill.readthedocs.io/en/latest/)

*Optional requirements to run demos*: [Pandas](https://pandas.pydata.org/), [GeoPandas](https://geopandas.org/en/stable/), [Matplotlib](https://matplotlib.org/), [Shapely](https://shapely.readthedocs.io/en/stable/manual.html)
_Optional requirements to run demos_: [Pandas](https://pandas.pydata.org/), [GeoPandas](https://geopandas.org/en/stable/), [Matplotlib](https://matplotlib.org/), [Shapely](https://shapely.readthedocs.io/en/stable/manual.html)

Please consider [contributing](./docs/CONTRIBUTING.md) and note the [code of conduct](./docs/CODE_OF_CONDUCT.md)

Expand Down Expand Up @@ -84,13 +84,13 @@ pip install -e .[dev,demos]

If you would like to use our software, please cite it using the following:

> Dobson, B., Liu, L. and Mijic, A. (2023)
‘Water Systems Integrated Modelling framework, WSIMOD: A Python package for integrated modelling of water quality and quantity across the water cycle’,
Journal of Open Source Software.
The Open Journal,
8(83),
p. 4996.
doi: 10.21105/joss.04996.
> Dobson, B., Liu, L. and Mijic, A. (2023)
> ‘Water Systems Integrated Modelling framework, WSIMOD: A Python package for integrated modelling of water quality and quantity across the water cycle’,
> Journal of Open Source Software.
> The Open Journal,
> 8(83),
> p. 4996.
> doi: 10.21105/joss.04996.
Find the bibtex citation below:

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"
services:
wsimod:
build: .
Expand Down
21 changes: 10 additions & 11 deletions docs/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities
Expand Down
Loading

0 comments on commit b26fac5

Please sign in to comment.