Skip to content
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
22 changes: 15 additions & 7 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,28 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
python-version: '3.10'

- name: Upgrade pip and install build tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
pip install build twine

- name: Build package
run: |
python -m build # builds both sdist and wheel in dist/

- name: Publish to PyPI
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
python -m twine upload dist/*
39 changes: 16 additions & 23 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI

on:
Expand All @@ -11,52 +8,48 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
python-version: ["3.8","3.9","3.10","3.11","3.12","3.13"]

steps:
- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install zenodo_get
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Upgrade pip and build tools
run: python -m pip install --upgrade pip setuptools wheel build

- name: Install brukerapi
- name: Install brukerapi with dev dependencies
run: |
git clone https://github.com/isi-nmr/brukerapi-python.git
cd brukerapi-python
python setup.py build
python setup.py install
pip install pytest zenodo_get
pip install -e .[dev] --use-pep517

- name: Download test data from Zenodo
run: |
cd brukerapi-python/test
zenodo_get 10.5281/zenodo.4522220
working-directory: brukerapi-python/test
run: python -m zenodo_get 10.5281/zenodo.4522220

- name: Test using the PV5.1 data set
working-directory: brukerapi-python/test
run: |
cd brukerapi-python/test
unzip 0.2H2.zip
python -m pytest . --test_data "0.2H2" --test_suites="test_data" -v

- name: Test using the PV6.0.1 data set
working-directory: brukerapi-python/test
run: |
cd brukerapi-python/test
unzip 20200612_094625_lego_phantom_3_1_2.zip
python -m pytest --test_data "20200612_094625_lego_phantom_3_1_2" --test_suites="test_data" -v
python -m pytest . --test_data "20200612_094625_lego_phantom_3_1_2" --test_suites="test_data" -v

- name: Test using the PV7.0.0 data set
working-directory: brukerapi-python/test
run: |
cd brukerapi-python/test
unzip 20210128_122257_LEGO_PHANTOM_API_TEST_1_1.zip
python -m pytest --test_data "20210128_122257_LEGO_PHANTOM_API_TEST_1_1" --test_suites="test_data" -v
python -m pytest . --test_data "20210128_122257_LEGO_PHANTOM_API_TEST_1_1" --test_suites="test_data" -v
34 changes: 34 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[build-system]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "brukerapi"
version = "0.1.9"
description = "Bruker API"
authors = [
{ name="Tomas Psorn", email="tomaspsorn@isibrno.cz" }
]
license = { text="MIT" }
readme = "README.rst"
requires-python = ">=3.8"
dependencies = [
"numpy<2; python_version<'3.9'",
"numpy>=1.26.0; python_version>='3.9'",
"pyyaml"
]
urls = { "Homepage" = "https://github.com/isi-nmr/brukerapi-python","Download" = "https://github.com/isi-nmr/brukerapi-python/releases/latest"}

[project.scripts]
bruker = "brukerapi.cli:main"

[tool.setuptools]
packages = ["brukerapi", "brukerapi.config"]
include-package-data = true
zip-safe = false

[project.optional-dependencies]
dev = [
"pytest",
"zenodo_get"
]
21 changes: 0 additions & 21 deletions setup.py

This file was deleted.