refactor: Update package name in dependencies #25
  
    
      This file contains hidden or 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
    
  
  
    
  | on: [push, pull_request] | |
| name: release-please | |
| jobs: | |
| # linting: | |
| # name: Linting | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - name: Install dependencies | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # pip install black ruff | |
| # - name: Autoformat with black | |
| # run: | | |
| # black . | |
| # - name: Lint with ruff | |
| # run: | | |
| # ruff check LoopProjectFile --fix | |
| # - uses: stefanzweifel/git-auto-commit-action@v5 | |
| # with: | |
| # commit_message: "style: style fixes by ruff and autoformatting by black" | |
| continuous-integration: | |
| name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - macos-12 | |
| - macos-13 | |
| - macos-14 | |
| - macos-15 | |
| - windows-latest | |
| - windows-2019 | |
| python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Installing dependencies | |
| shell: bash -l {0} | |
| run: | | |
| conda install -c conda-forge -c loop3d --file requirements.txt -y | |
| - name: Building and install | |
| shell: bash -l {0} | |
| run: | | |
| pip install . --user | |
| # Cache conda environments | |
| - name: Cache conda environment | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/conda_pkgs_dir | |
| key: ${{ runner.os }}-conda-${{ matrix.python-version }} | |
| restore-keys: | | |
| ${{ runner.os }}-conda- | |
| # - name: Test verification | |
| # shell: bash -l {0} | |
| # run: | | |
| # pytest | |
| release-please: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for all tags and branches | |
| - uses: GoogleCloudPlatform/release-please-action@v4 | |
| id: release | |
| with: | |
| release-type: python | |
| package-name: LoopProjectFile | |
| version-file: LoopProjectFile/version.py | |
| outputs: | |
| release_created: ${{ steps.release.outputs.release_created }} | |
| # if a release is created then run the deploy scripts for github.io, conda, pypi and docker | |
| conda-deploy: | |
| name: Building conda package for ${{ matrix.os-conda }}) python ${{ matrix.python-version }} | |
| needs: "continuous-integration" | |
| runs-on: ${{matrix.os-conda}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os-conda: | |
| - linux-64 | |
| - aaarch64 | |
| - osx-64 | |
| - osx-arm64 | |
| - win-64 | |
| python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
| steps: | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| auto-update-conda: true | |
| python-version: ${{ matrix.python-version }} | |
| - uses: actions/checkout@v4 | |
| - name: update submodules | |
| # shell: bash -l {0} | |
| run: | | |
| git submodule update --init --recursive | |
| - name: Conda build | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| shell: bash -l {0} | |
| run: | | |
| conda install --solver=classic -c conda-forge conda-build anaconda-client conda-libmamba-solver -y | |
| conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --platform ${{ matrix.os-conda }} --python ${{ matrix.python-version }} | |
| conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda | |
| conda install anaconda-client -y | |
| - name: upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: conda-${{ matrix.os-conda }}-${{ matrix.python-version }} | |
| path: conda | |
| build-sdist: | |
| needs: "continuous-integration" | |
| name: Build SDist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build SDist | |
| run: | | |
| pip install build | |
| python -m build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: loopprojectfile-dist | |
| path: dist/*.tar.gz | |
| compression-level: 0 | |
| test-sdist: | |
| name: Test sdist | |
| needs: build-sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Create virtual environment | |
| # install uv and use it to create a virtual environment, then add it to | |
| # environment variables so that it is automatically activated and can be | |
| # used for tests below | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| . $HOME/.cargo/env | |
| uv venv .venv | |
| echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
| echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Download sdist from artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: loopprojectfile-dist | |
| path: wheelhouse | |
| - name: Build LPF from sdist and install test dependencies | |
| shell: bash | |
| run: | | |
| uv pip install --no-cache wheelhouse/*.tar.gz | |
| uv pip install netCDF4>=1.5.4 numpy pandas pytest | |
| uv pip list | |
| build-wheels: | |
| needs: [build-sdist, test-sdist] | |
| name: Build Wheels | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - macos-12 | |
| - macos-13 | |
| - macos-14 | |
| - macos-15 | |
| - windows-latest | |
| - windows-2019 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Wheels | |
| run: | | |
| pip install build | |
| python -m build --wheel | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: loopprojectfile-wheels-${{ matrix.os }} | |
| path: ./wheelhouse/*.whl | |
| compression-level: 0 | |
| test-wheels: | |
| name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) | |
| needs: build-wheels | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - macos-12 | |
| - macos-13 | |
| - macos-14 | |
| - macos-15 | |
| - windows-latest | |
| - windows-2019 | |
| python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
| include: | |
| - os: "ubuntu-latest" | |
| artifact: loopprojectfile-wheels-ubuntu-latest | |
| - os: "macos-latest" | |
| artifact: loopprojectfile-wheels-macos-latest | |
| - os: "macos-12" | |
| artifact: loopprojectfile-wheels-macos-12 | |
| - os: "macos-13" | |
| artifact: loopprojectfile-wheels-macos-13 | |
| - os: "macos-14" | |
| artifact: loopprojectfile-wheels-macos-14 | |
| - os: "macos-15" | |
| artifact: loopprojectfile-wheels-macos-15 | |
| - os: "windows-2019" | |
| artifact: loopprojectfile-wheels-windows-2019 | |
| - os: "windows-latest" | |
| artifact: loopprojectfile-wheels-windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| allow-prereleases: true | |
| - name: Create virtual environment (Linux / MacOS) | |
| # install uv and use it to create a virtual environment, then add it to | |
| # environment variables so that it is automatically activated and can be | |
| # used for tests below | |
| if: ${{ runner.os != 'Windows' }} | |
| shell: bash | |
| run: | | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| . $HOME/.cargo/env | |
| uv venv .venv | |
| echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV | |
| echo "$PWD/.venv/bin" >> $GITHUB_PATH | |
| - name: Create virtual environment (Windows) | |
| if: ${{ runner.os == 'Windows' }} | |
| run: | | |
| irm https://astral.sh/uv/install.ps1 | iex | |
| uv venv .venv | |
| "VIRTUAL_ENV=.venv" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| "$PWD/.venv/Scripts" | Out-File -FilePath $env:GITHUB_PATH -Append | |
| - name: Download wheels from artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: wheelhouse | |
| - name: Install dependencies and LoopProjectFile wheel | |
| shell: bash | |
| run: | | |
| uv pip install --no-cache --pre --no-index --find-links wheelhouse loopprojectfile | |
| uv pip list | |
| upload_to_conda: | |
| needs: ["release-please", "conda-deploy"] | |
| runs-on: ${{matrix.os}} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: ["ubuntu-latest"] | |
| python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}} | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: conda-${{ matrix.os }}-${{ matrix.python-version }} | |
| path: conda | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| - name: upload all files to conda-forge | |
| shell: bash -l {0} | |
| env: | |
| ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
| run: | | |
| conda install -c anaconda anaconda-client -y | |
| anaconda upload --label main conda/*/*.tar.bz2 | |
| upload_to_pypi: | |
| runs-on: "ubuntu-latest" | |
| needs: ["release-please", build-sdist] | |
| if: ${{ needs.release-please.outputs.release_created }} | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: loopprojectfile-dist | |
| path: dist/*.tar.gz | |
| - uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| skip-existing: true | |
| verbose: true |