Skip to content
Closed
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
64 changes: 32 additions & 32 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
"streamlit_app.py"
]
},
"vscode": {
"settings": {},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
}
},
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'",
"postAttachCommand": {
"server": "streamlit run streamlit_app.py --server.enableCORS false --server.enableXsrfProtection false"
},
"portsAttributes": {
"8501": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [
8501
]
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bookworm",
"customizations": {
"codespaces": {
"openFiles": [
"README.md",
"streamlit_app.py"
]
},
"vscode": {
"settings": {},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
]
}
},
"updateContentCommand": "[ -f packages.txt ] && sudo apt update && sudo apt upgrade -y && sudo xargs apt install -y <packages.txt; [ -f requirements.txt ] && pip3 install --user -r requirements.txt; pip3 install --user streamlit; echo '✅ Packages installed and Requirements met'",
"postAttachCommand": {
"server": "streamlit run streamlit_app.py --server.enableCORS false --server.enableXsrfProtection false"
},
"portsAttributes": {
"8501": {
"label": "Application",
"onAutoForward": "openPreview"
}
},
"forwardPorts": [
8501
]
}
44 changes: 44 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# VCS
.git
.gitignore
.github/

# Python cache/bytecode
__pycache__/
*.py[cod]
*$py.class

# Build/packaging artifacts
build/
dist/
*.egg-info/
.eggs/

# Test and coverage artifacts
.pytest_cache/
.coverage
coverage.xml
htmlcov/
.mypy_cache/
.ruff_cache/

# Virtual environments
.venv/
venv/
env/

# Local editor/tooling
.vscode/
.idea/
.DS_Store

# Local data and outputs
tmp/
out/
results/
results_cache/
*.zip

# Optional: keep large or generated content out of image context
Data/
fibermorph/test_data/
30 changes: 15 additions & 15 deletions .github/workflows/conventional-prs.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: PR
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize

jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
name: PR
on:
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
jobs:
title-format:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v3.4.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148 changes: 74 additions & 74 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
name: Release

# release on push version tag, e.g. v0.3.2
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:

permissions:
contents: write
id-token: write

env:
PYTHON_VERSION: 3.11

jobs:
build:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/fibermorph/
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
run: python -m pip install --upgrade pip poetry

- name: Install build tools
run: python -m pip install build twine

- name: Check if tag matches the package version
run: |
PKG_VERSION=$(poetry version -s)
TAG=${GITHUB_REF#refs/tags/}
if [[ "v$PKG_VERSION" != "$TAG" ]]; then
echo "Error: Tag ($TAG) does not match the package version (v$PKG_VERSION)."
exit 1
fi

- name: Build sdist and universal wheel
run: python -m build --sdist --wheel --outdir dist

- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
artifacts: "dist/*"
allowUpdates: true
updateOnlyUnreleased: false

- name: Check if version already exists on PyPI
id: pypi_check
run: |
PKG_VERSION=$(poetry version -s)
PKG_NAME=$(poetry version | awk '{print $1}')
if curl -sSf https://pypi.org/pypi/$PKG_NAME/json | grep -q "\"$PKG_VERSION\""; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Version $PKG_VERSION already exists on PyPI. Will skip publish."
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Version $PKG_VERSION does not exist on PyPI. Will publish."
fi

- name: Publish to PyPI via Trusted Publishing
if: steps.pypi_check.outputs.exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
name: Release
# release on push version tag, e.g. v0.3.2
on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
permissions:
contents: write
id-token: write
env:
PYTHON_VERSION: 3.11
jobs:
build:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/fibermorph/
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: python -m pip install --upgrade pip poetry
- name: Install build tools
run: python -m pip install build twine
- name: Check if tag matches the package version
run: |
PKG_VERSION=$(poetry version -s)
TAG=${GITHUB_REF#refs/tags/}
if [[ "v$PKG_VERSION" != "$TAG" ]]; then
echo "Error: Tag ($TAG) does not match the package version (v$PKG_VERSION)."
exit 1
fi
- name: Build sdist and universal wheel
run: python -m build --sdist --wheel --outdir dist
- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
artifacts: "dist/*"
allowUpdates: true
updateOnlyUnreleased: false
- name: Check if version already exists on PyPI
id: pypi_check
run: |
PKG_VERSION=$(poetry version -s)
PKG_NAME=$(poetry version | awk '{print $1}')
if curl -sSf https://pypi.org/pypi/$PKG_NAME/json | grep -q "\"$PKG_VERSION\""; then
echo "exists=true" >> $GITHUB_OUTPUT
echo "Version $PKG_VERSION already exists on PyPI. Will skip publish."
else
echo "exists=false" >> $GITHUB_OUTPUT
echo "Version $PKG_VERSION does not exist on PyPI. Will publish."
fi
- name: Publish to PyPI via Trusted Publishing
if: steps.pypi_check.outputs.exists == 'false'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
skip-existing: true
Loading
Loading