Skip to content
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
101 changes: 58 additions & 43 deletions .github/workflows/release-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,52 @@ jobs:
echo "tagname=v$VER" >> "$GITHUB_OUTPUT"
fi

publish_wheels:
name: Publish PyPI
needs: autotag
if: ${{ needs.autotag.outputs.tagcreated == 'yes' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Wheels
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel build twine
python -m build --sdist --wheel

- name: Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PY_PI_TOKEN }}
shell: bash
run: twine upload dist/*

- name: Upload to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.autotag.outputs.tagname }}
file_glob: true
file: dist/*
overwrite: true


publish_assets:
name: Build and publish assets
needs: autotag
if: ${{ needs.autotag.outputs.tagcreated == 'yes' }}
runs-on: windows-latest
strategy:
matrix:
type: ['CPU']
flavor: [ cpu, cuda, openvino ]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -64,62 +102,39 @@ jobs:
with:
python-version: "3.12"

- name: Check versions
shell: bash
run: |
pip install tomli
python checks.py

- name: Setup for ${{ matrix.type }} Build
- name: Install Briefcase & WiX 5
shell: pwsh
env:
BUILD_TYPE: ${{ matrix.type }}
run: |
if ($env:BUILD_TYPE -eq 'GPU') {
Move-Item -Path .\pyproject_gpu.toml -Destination .\pyproject.toml -Force
}

- name: ${{ matrix.type }} - Install Wheels
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel build twine
python -m build --sdist --wheel

- name: ${{ matrix.type }} - Upload to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PY_PI_TOKEN }}
shell: bash
run: twine upload dist/*

- name: ${{ matrix.type }} - Install Builder
run: |
python -m pip install briefcase
# Install WiX v5 CLI (required by recent Briefcase)
python -m pip install "briefcase==0.3.25"
dotnet tool install --global wix --version 5.*
echo "$env:USERPROFILE\.dotnet\tools" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: ${{ matrix.type }} - Create Package
- name: Map flavor → app name
id: map
shell: pwsh
run: |
Remove-Item -Path .\build -Recurse -Force
briefcase create
$app = switch ("${{ matrix.flavor }}") {
"cpu" { "fbcpu" }
"cuda" { "fbcuda" }
"openvino" { "fbopenvino" }
}
echo "APP=$app" >> $env:GITHUB_OUTPUT

- name: ${{ matrix.type }} - Build Package
- name: Create
shell: pwsh
run: briefcase build
run: briefcase create windows --app ${{ steps.map.outputs.APP }}

- name: ${{ matrix.type }} - Create Installer MSI
- name: Build
shell: pwsh
run: |
briefcase package --adhoc-sign --packaging-format msi
Remove-Item -Path .\dist\*.wixpdb -Force
- name: ${{ matrix.type }} - Create Installer ZIP
run: briefcase build windows --app ${{ steps.map.outputs.APP }} -r

- name: Package ZIP
shell: pwsh
run: briefcase package --adhoc-sign --packaging-format zip
run: briefcase package windows --app ${{ steps.map.outputs.APP }} --adhoc-sign --packaging-format zip


- name: ${{ matrix.type }} - Upload assets to GitHub Release
- name: Upload assets to GitHub Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install project
run: |
python -m pip install --upgrade pip
pip install -e .
pip install .[standard,dev]

- name: Tests
run: make run_tests
25 changes: 0 additions & 25 deletions .github/workflows/tomls.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,3 @@ run_precommit:
run_tests:
pytest -sv --disable-warnings tests

.PHONY: build_wheel
build_wheel:
python -m pip install --upgrade pip
python -m pip install --upgrade twine
pip install --upgrade pip setuptools wheel
rm -rf dist build first_breaks_picking.egg-info
python setup.py sdist bdist_wheel

.PHONY: upload_to_pip
upload_to_pip: build_wheel
twine upload dist/*
33 changes: 16 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,30 +83,29 @@ The latest model was trained similarly, but:

# Installation

Library is available in [PyPI](https://pypi.org/project/first-breaks-picking/):
The easiest way to install:
```shell
pip install -U first-breaks-picking
pip install -U first-breaks-picking[standard]
```

### GPU support
With a `standard` installation, you can run a desktop application and all calculations will be done using the CPU.

You can use the capabilities of GPU (discrete, not integrated with CPU) to significantly reduce picking time. Before started, check
[here](https://developer.nvidia.com/cuda-gpus) that your GPU is CUDA compatible.

Install GPU supported version of library:
Other installation methods:
```shell
pip install -U first-breaks-picking-gpu
```
# CPU, NO desktop application
pip install -U first-breaks-picking[engine-cpu]

# CUDA accelerated, NO desktop application
pip install -U first-breaks-picking[engine-cuda]

The following steps are operating system dependent and must be performed manually:
# CPU + desktop application, same as `standard`
pip install -U first-breaks-picking[engine-cpu,desktop]

# CUDA accelerated + desktop application
pip install -U first-breaks-picking[engine-cuda,desktop]
```

- Install [latest NVIDIA drivers](https://www.nvidia.com/Download/index.aspx).
- Install [CUDA toolkit](https://developer.nvidia.com/cuda-downloads).
**The version must be between 11.x, starting with 11.6.
Version 12 also may work, but versions >=11.6 are recommended**.
- Install ZLib and CuDNN:
[Windows](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-windows) and
[Linux](https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#install-linux).
We use `onnxruntime` as engine for neural network. You can find the engine's dependencies on the [official page](https://onnxruntime.ai/docs/install/).

### Compiled desktop application

Expand Down
116 changes: 0 additions & 116 deletions checks.py

This file was deleted.

Empty file added fbcpu/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions fbcpu/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import runpy
runpy.run_module("first_breaks", run_name="__main__")
Empty file added fbcuda/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions fbcuda/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import runpy
runpy.run_module("first_breaks", run_name="__main__")
Empty file added fbcudasystem/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions fbcudasystem/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import runpy
runpy.run_module("first_breaks", run_name="__main__")
Empty file added fbopenvino/__init__.py
Empty file.
2 changes: 2 additions & 0 deletions fbopenvino/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import runpy
runpy.run_module("first_breaks", run_name="__main__")
2 changes: 1 addition & 1 deletion first_breaks/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.0
0.9.0a5
Loading