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

hatching #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Build and Test

on:
push:
branches: [ "ESAEOEPCA-182" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: |
# python -m pip install --upgrade pip
pip install hatch
- name: Cache Hatch
id: cache-hatch
uses: actions/cache@v3
with:
path: /home/runner/.local/share/hatch/env/virtual/
key: ${{ runner.os }}-hatch
- name: Build
run: hatch build
- name: Test
run: |
hatch -e test run nose2 --verbose
39 changes: 39 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to PyPI

on:
push:
branches: [ "ESAEOEPCA-182" ]
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

environment: release
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
# python -m pip install --upgrade pip
pip install hatch
- name: Build package
run: hatch build
- name: Test package
run: hatch -e test run nose2 --verbose
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
1 change: 1 addition & 0 deletions pycalrissian/__about__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "0.7.1"
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[build-system]
requires = ["hatchling","setuptools", "wheel", "build"]
build-backend = "hatchling.build"

[project]
name = "pycalrissian"
dynamic = ["version"]
description = "pycalrissian"
readme = "README.md"
requires-python = ">=3.8"
keywords = ["pycalrissian", "kubernetes"]
license = "EUPL-1.0"
authors = [
{ name = "Terradue", email = "[email protected]" },
]

classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = []

[project.urls]
Homepage = "https://github.com/Terradue/pycalrissian"

[tool.hatch.version]
path = "pycalrissian/__about__.py"

[tool.hatch.build.targets.sdist]
include = [
"pycalrissian/*",
"docs/*",
"test/*"
]

[tool.hatch.envs.types]
extra-dependencies = [
"loguru",
"typing",
"kubernetes==28.1.0",
]


[tool.coverage.run]
source_pkgs = ["pycalrissian", "tests"]
branch = true
parallel = true
omit = [
"pycalrissian/__about__.py",
]

[tool.coverage.paths]
pycalrissian = ["pycalrissian"]
tests = ["tests"]

[tool.hatch.envs.default]
skip-install = false
dependencies = [
"nose2",
"coverage",
"loguru",
"typing-extensions==4.8.0",
"kubernetes==28.1.0",
"cwltool==3.1.20240708091337",
"setuptools==70.0.0"
]


## [project.scripts]
## pycalrissian = "pycalrissian/__init__"


[tool.hatch.envs.test.scripts]
test = "hatch run nose2"
testv = "hatch run nose2 --verbose"
cov = ["coverage run --source=pycalrissian -m nose2", "coverage report"]