Skip to content

Commit b951cd1

Browse files
authored
v0.14.2
version 0.14.2
2 parents b9e834e + eabf94d commit b951cd1

File tree

5 files changed

+76
-49
lines changed

5 files changed

+76
-49
lines changed

.github/workflows/pypi.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ on:
66
jobs:
77
build-n-publish:
88
name: Build and publish package to PyPI
9-
runs-on: ubuntu-18.04
9+
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@master
12-
- name: Set up Python 3.7
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
1313
uses: actions/setup-python@v1
1414
with:
15-
python-version: 3.7
16-
- name: Install Cython and numpy
17-
run: python3 -m pip install --user cython numpy
18-
- name: Install wheel
19-
run: python3 -m pip install --user --upgrade setuptools wheel
20-
- name: Build a binary wheel and a source tarball
21-
run: python3 setup.py sdist
22-
- name: Publish distribution to PyPI
23-
if: startsWith(github.ref, 'refs/tags')
24-
uses: pypa/gh-action-pypi-publish@master
25-
with:
26-
password: ${{ secrets.pypi_password }}
15+
python-version: "3.7"
16+
- name: Install poetry
17+
run: |
18+
curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
19+
python get-poetry.py -y
20+
- name: Publish
21+
env:
22+
PYPI_TOKEN: ${{ secrets.pypi_password }}
23+
run: |
24+
$HOME/.poetry/bin/poetry config pypi-token.pypi $PYPI_TOKEN
25+
$HOME/.poetry/bin/poetry build -f sdist
26+
$HOME/.poetry/bin/poetry publish

build.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
3+
from setuptools import Extension, Distribution
4+
import numpy
5+
from Cython.Build import cythonize
6+
from Cython.Distutils.build_ext import new_build_ext as cython_build_ext
7+
8+
9+
def build():
10+
# compile FLI library
11+
os.system('cd lib && make && cd ..')
12+
13+
extensions = [
14+
Extension(
15+
'pyobs_fli.flidriver',
16+
['pyobs_fli/flidriver.pyx'],
17+
library_dirs=['lib/'],
18+
libraries=['fli', 'cfitsio'],
19+
include_dirs=[numpy.get_include()],
20+
extra_compile_args=['-fPIC']
21+
)
22+
]
23+
ext_modules = cythonize(extensions)
24+
25+
distribution = Distribution({
26+
"name": "extended",
27+
"ext_modules": ext_modules,
28+
"cmdclass": {
29+
"build_ext": cython_build_ext,
30+
},
31+
})
32+
33+
distribution.run_command("build_ext")
34+
build_ext_cmd = distribution.get_command_obj("build_ext")
35+
build_ext_cmd.copy_extensions_to_source()
36+
37+
38+
if __name__ == "__main__":
39+
build()

pyproject.toml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[tool.poetry]
2+
name = "pyobs-fli"
3+
version = "0.14.2"
4+
description = "pyobs module for FLI cameras"
5+
authors = ["Tim-Oliver Husser <[email protected]>"]
6+
license = "MIT"
7+
include = ['lib']
8+
9+
[tool.poetry.build]
10+
script = "build.py"
11+
generate-setup-file = false
12+
13+
[tool.poetry.dependencies]
14+
python = "^3.7"
15+
numpy = "^1.21"
16+
astropy = "^4.2"
17+
18+
[tool.poetry.dev-dependencies]
19+
20+
[build-system]
21+
requires = ["poetry-core>=1.0.0", "Cython>=0.29.0", "numpy>=1.21.0", "setuptools"]
22+
build-backend = "poetry.core.masonry.api"

requirements.txt

-1
This file was deleted.

setup.py

-33
This file was deleted.

0 commit comments

Comments
 (0)