-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split packages and add publish action
- Loading branch information
1 parent
28278d5
commit 8ae4fb5
Showing
152 changed files
with
1,944 additions
and
706 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Publish Release | ||
on: | ||
push: | ||
branches: | ||
- release_bfabric | ||
- release_bfabric_scripts | ||
- release_app_runner | ||
workflow_dispatch: | ||
inputs: | ||
package: | ||
description: 'Package to release' | ||
type: choice | ||
options: | ||
- bfabric | ||
- bfabric_scripts | ||
- app_runner | ||
default: bfabric | ||
environment: | ||
description: 'Target PyPI' | ||
type: choice | ||
options: | ||
- test | ||
- production | ||
default: test | ||
required: true | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Step: Determine the package that is being built | ||
- name: Set package variable | ||
id: set-package | ||
run: | | ||
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | ||
echo "PACKAGE=${{ github.event.inputs.package }}" >> $GITHUB_ENV | ||
else | ||
# Extract package name from branch name by removing 'release_' prefix | ||
BRANCH_NAME="${{ github.ref_name }}" | ||
PACKAGE=${BRANCH_NAME#release_} | ||
echo "PACKAGE=$PACKAGE" >> $GITHUB_ENV | ||
fi | ||
# Step: Set the PyPI repository URL based on environment | ||
- name: Set PyPI repository URL | ||
id: set-repo-url | ||
run: | | ||
if [ "${{ github.event.inputs.environment }}" == "production" ] || [ "${{ github.event_name }}" == "push" ]; then | ||
echo "PYPI_REPOSITORY_URL=https://pypi.org/legacy/" >> $GITHUB_ENV | ||
else | ||
echo "PYPI_REPOSITORY_URL=https://test.pypi.org/legacy/" >> $GITHUB_ENV | ||
fi | ||
- name: Debug variables | ||
run: | | ||
echo "Selected package: ${{ env.PACKAGE }}" | ||
echo "Target PyPI repository: ${{ env.PYPI_REPOSITORY_URL }}" | ||
# Step: Build the package | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install hatch | ||
run: pip install hatch | ||
- name: Build package | ||
run: | | ||
cd ${{ env.PACKAGE }} | ||
hatch build | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: ${{ env.PYPI_REPOSITORY_URL }} | ||
packages-dir: ${{ env.PACKAGE }}/dist | ||
- name: Debug package info | ||
run: | | ||
echo "Built and published package: ${{ env.PACKAGE }}" | ||
if [ "${{ env.PYPI_REPOSITORY_URL }}" == "https://pypi.org/legacy/" ]; then | ||
echo "Check it at: https://pypi.org/project/${{ env.PACKAGE }}/" | ||
else | ||
echo "Check it at: https://test.pypi.org/project/${{ env.PACKAGE }}/" | ||
fi |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[pytest] | ||
logot_capturer = logot.loguru.LoguruCapturer |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "bfabric" | ||
description = "Python client for the B-Fabric API" | ||
version = "1.13.18" | ||
license = { text = "GPL-3.0" } | ||
authors = [ | ||
{ name = "Christian Panse", email = "cp@fgcz.ethz.ch" }, | ||
{ name = "Leonardo Schwarz", email = "leonardo.schwarz@fgcz.ethz.ch" }, | ||
{ name = "Aleksejs Fomins" }, | ||
{ name = "Marco Schmidt" }, | ||
{ name = "Maria d'Errico" }, | ||
{ name = "Witold Eryk Wolski" }, | ||
] | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"suds >= 1.1.2", | ||
"PyYAML >= 6.0", | ||
"Flask >= 3.0.3", | ||
"rich >= 13.7.1", | ||
"zeep >= 4.2.1", | ||
"polars-lts-cpu >= 0.20.25; platform_machine == 'x86_64' and platform_system == 'Darwin'", | ||
"polars >= 0.20.25; platform_machine != 'x86_64' or platform_system != 'Darwin'", | ||
"loguru>=0.7", | ||
"pydantic>=2.9.2", | ||
"eval_type_backport; python_version < '3.10'", | ||
"python-dateutil >= 2.9.0", | ||
"cyclopts >= 2.9.9", | ||
#"platformdirs >= 4.3", | ||
] | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"bfabric[doc,test]", | ||
"black", | ||
"isort", | ||
"ruff", | ||
"licensecheck", | ||
"nox", | ||
"uv", | ||
"ipython", | ||
] | ||
doc = ["mkdocs", "mkdocs-material", "mkdocstrings[python]"] | ||
test = ["pytest", "pytest-mock", "logot[pytest,loguru]"] | ||
typing = ["mypy", "types-requests", "lxml-stubs", "pandas-stubs", "types-python-dateutil"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/fgcz/bfabricPy" | ||
Repository = "https://github.com/fgcz/bfabricPy" | ||
|
||
|
||
[tool.uv] | ||
reinstall-package = ["bfabric", "bfabric_scripts", "app_runner"] | ||
|
||
[tool.black] | ||
line-length = 120 | ||
target-version = ["py39"] | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
indent-width = 4 | ||
target-version = "py39" | ||
|
||
[tool.ruff.lint] | ||
select = ["ANN", "BLE", "D103", "E", "EXE", "F", "N", "PLW", "PTH", "SIM", "TCH", "UP", "W191"] | ||
ignore = ["ANN401"] | ||
|
||
[tool.ruff.lint.per-file-ignores] | ||
"**/bfabric_scripts/**" = ["ALL"] | ||
"**/wrapper_creator/**" = ["ALL"] | ||
"**/examples/**" = ["ALL"] | ||
"**/tests/**" = ["ALL"] | ||
"noxfile.py" = ["ALL"] | ||
|
||
[tool.licensecheck] | ||
using = "PEP631" | ||
|
||
#[tool.pytest.ini_options] | ||
#logot_capturer = "logot.loguru.LoguruCapturer" | ||
|
||
#[tool.check-tests-structure] | ||
#sources_path = "src/bfabric" | ||
#tests_path = "tests/unit" | ||
#allow_missing_tests = true |
File renamed without changes.
Oops, something went wrong.