Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyproject #1

Merged
merged 3 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build_python_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and Test Package

on:
push:
branches:
- master
pull_request:

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetch all history to ensure tags are available

# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.12 # Change to the desired Python version

# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build

# Build the package
- name: Build the package
run: |
python -m build

# Test importing the package
- name: Test the package import
run: |
python -m pip install dist/*.whl
python -c "import pynemaiqpet; print('pynemaiqpet version:', pynemaiqpet.__version__)"
pynemaiqpet_wb_nema_iq -h
10 changes: 5 additions & 5 deletions pynemaiqpet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version, PackageNotFoundError

try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass
__version__ = version("pynemaiqpet")
except PackageNotFoundError:
__version__ = "unknown"
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[build-system]
requires = ["setuptools >= 61.0", "wheel", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = { find = { include = ["pynemaiqpet*"], exclude = ["scripts*"] } }

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "dirty-tag"

[project]
name = "pynemaiqpet"
dynamic = ["version"]
dependencies = [
"pymirc>=0.23,<1",
"nibabel>=3.0",
"matplotlib>=3.1",
"pydicom>=2.0,<3",
"scipy>=1.4",
"pandas>=1.0",
"lmfit>=1.0"
]
requires-python = ">=3.8"
authors = [
{name = "Georg Schramm"},
]
maintainers = [
{name = "Georg Schramm", email = "[email protected]"}
]
description="Analysis of PET NEMA IQ phantom scans"
readme = "README.md"
license = {file = "LICENSE"}
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]

[project.urls]
Repository = "https://github.com/gschramm/pynemaiqpet"

[project.entry-points.console_scripts]
pynemaiqpet_wb_nema_iq = "pynemaiqpet.command_line_tools:wb_nema_iq"
48 changes: 0 additions & 48 deletions recipe/meta.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions setup.py

This file was deleted.