Skip to content

Commit

Permalink
Merge pull request #21 from ornlneutronimaging/pypi_conda_pkg
Browse files Browse the repository at this point in the history
Pypi conda pkg
  • Loading branch information
KedoKudo authored Jul 8, 2024
2 parents 23e75d3 + 39f5f84 commit ab850a9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 5 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,32 @@ jobs:
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
anaconda upload --label $CONDA_LABEL conda.recipe/noarch/bm3dornl*.tar.bz2
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
channels: conda-forge,defaults
mamba-version: "*"
environment-file: environment.yml
cache-environment-key: ${{ runner.os }}-env-${{ hashFiles('**/environment.yml') }}
cache-downloads-key: ${{ runner.os }}-downloads-${{ hashFiles('**/environment.yml') }}
- name: build pypi pacakge
run: |
echo "versioningit $(versioningit .)"
# build the package
VERSION=$(versioningit .) python -m build
# retrieve your distributions here
- name: Publish package distributions to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1
18 changes: 18 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,28 @@ requirements:

run:
- python
- numpy
- scipy<1.13
- numba
- cupy
- scikit-image

test:
imports:
- bm3dornl

channels:
- conda-forge
- nvidia
- defaults

about:
home: {{ url }}
license: {{ license }}
license_family: MIT
license_file: ../LICENSE
summary: {{ description }}

extra:
recipe-maintainers:
- kedokudo
18 changes: 13 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
[project]
name = "bm3dornl"
description = "BM3D repo"
description = "BM3D for streak artifact removal in neutron imaging"
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = [
# list all runtime dependencies here
"numpy",
"scipy<1.13", # avoid a bug
"numba",
"cupy-cuda12x", # use pre-built wheels
"scikit-image",
]
license = { text = "MIT" }
keywords = ["BM3D", "image processing", "neutron imaging", "denoising", "CuPy", "Numba"]
readme = "README.md"

[project.urls]
homepage = "https://github.com/neutrons/python_project_template/" # if no homepage, use repo url
homepage = "https://github.com/neutrons/python_project_template/"
repository = "https://github.com/ornlneutronimaging/bm3dornl"
documentation = "https://bm3dornl.readthedocs.io/en/latest/"
issues = "https://github.com/ornlneutronimaging/bm3dornl/issues"


[build-system]
requires = [
Expand Down Expand Up @@ -70,5 +80,3 @@ disable = ["too-many-locals",
"too-many-arguments",
"duplicate-code"
]

# Add additional 3rd party tool configuration here as needed

0 comments on commit ab850a9

Please sign in to comment.