From 74470dcc77a299ada64132317ad6e80d96c4ad35 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Tue, 20 Aug 2024 14:37:44 +0200 Subject: [PATCH 1/5] add package build and upload to pypi in cicd --- .github/workflows/ci-pypi-deploy.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/ci-pypi-deploy.yml diff --git a/.github/workflows/ci-pypi-deploy.yml b/.github/workflows/ci-pypi-deploy.yml new file mode 100644 index 000000000..00f310133 --- /dev/null +++ b/.github/workflows/ci-pypi-deploy.yml @@ -0,0 +1,24 @@ +name: package-release + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + release: + types: + - published + +jobs: + build: + name: build and upload release to pypi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: casperdcl/deploy-pypi@v2 + with: + password: ${{ secrets.PYPI_TOKEN }} + pip: wheel -w dist/ --no-deps . + upload: ${{ github.event_name == 'release' && github.event.action == 'published' }} From 6fb2a9112249cdf64e6161ed77f86ebb4405d2e5 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Tue, 20 Aug 2024 14:47:58 +0200 Subject: [PATCH 2/5] add reference to README --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d66c00870..e8567fcf7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,7 @@ authors = [ {name = "Simon Adamov", email = "Simon.Adamov@meteoswiss.ch"}, {name = "Leif Denby", email = "lcd@dmi.dk"}, ] +readme = "README.md" # PEP 621 project metadata # See https://www.python.org/dev/peps/pep-0621/ From ee9581508f6fba8a603529d1f86ebde747976a43 Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Tue, 18 Feb 2025 13:46:18 +0000 Subject: [PATCH 3/5] Update .github/workflows/ci-pypi-deploy.yml Co-authored-by: Hauke Schulz <43613877+observingClouds@users.noreply.github.com> --- .github/workflows/ci-pypi-deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pypi-deploy.yml b/.github/workflows/ci-pypi-deploy.yml index 00f310133..926f8d6ff 100644 --- a/.github/workflows/ci-pypi-deploy.yml +++ b/.github/workflows/ci-pypi-deploy.yml @@ -15,8 +15,8 @@ jobs: name: build and upload release to pypi runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 - uses: casperdcl/deploy-pypi@v2 with: password: ${{ secrets.PYPI_TOKEN }} From 675f7dcc126403c9ef9e162acc7f5bb273a23ef7 Mon Sep 17 00:00:00 2001 From: Hauke Schulz <43613877+observingClouds@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:15:50 +0200 Subject: [PATCH 4/5] include pypi install instructions --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7dc6c7abd..8a702dfad 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,15 @@ expects the most recent version of CUDA on your system. We cover all the installation options in our [github actions ci/cd setup](.github/workflows/) which you can use as a reference. -### Using `pdm` +### From pypi.org + +``` +python -m pip install neural_lam +``` + +### From source + +#### Using `pdm` 1. Clone this repository and navigate to the root directory. 2. Install `pdm` if you don't have it installed on your system (either with `pip install pdm` or [following the install instructions](https://pdm-project.org/latest/#installation)). @@ -83,7 +91,7 @@ setup](.github/workflows/) which you can use as a reference. 4. Install a specific version of `torch` with `pdm run python -m pip install torch --index-url https://download.pytorch.org/whl/cpu` for a CPU-only version or `pdm run python -m pip install torch --index-url https://download.pytorch.org/whl/cu111` for CUDA 11.1 support (you can find the correct URL for the variant you want on [PyTorch webpage](https://pytorch.org/get-started/locally/)). 5. Install the dependencies with `pdm install` (by default this in include the). If you will be developing `neural-lam` we recommend to install the development dependencies with `pdm install --group dev`. By default `pdm` installs the `neural-lam` package in editable mode, so you can make changes to the code and see the effects immediately. -### Using `pip` +#### Using `pip` 1. Clone this repository and navigate to the root directory. > If you are happy using the latest version of `torch` with GPU support (expecting the latest version of CUDA is installed on your system) you can skip to step 3. From 469e4350b9806865448765e2fe07a5b83bc93941 Mon Sep 17 00:00:00 2001 From: Hauke Schulz <43613877+observingClouds@users.noreply.github.com> Date: Fri, 6 Jun 2025 13:23:33 +0200 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bad37866e..6e2238864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add option to clamp output prediction using limits specified in config file [\#92](https://github.com/mllam/neural-lam/pull/92) @SimonKamuk +- Add publication of releases to pypi.org. [\#71](https://github.com/mllam/neural-lam/pull/71) @leifdenby, @observingClouds + ### Fixed - Only print on rank 0 to avoid duplicates of all print statements. [\#103](https://github.com/mllam/neural-lam/pull/103) @simonkamuk @sadamov