Skip to content

Commit 0bc3463

Browse files
authored
Cython now requires a minimum version. Introduces setup.cfg. Cleans up the CI workflow (#629)
1 parent 7b0426a commit 0bc3463

File tree

5 files changed

+34
-52
lines changed

5 files changed

+34
-52
lines changed

Diff for: .github/workflows/push-x86.yml

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ jobs:
5050
- name: install
5151
run: |
5252
linux32 sh -ec '
53-
pip install --timeout=120 -U setuptools cython
5453
pip install --timeout=120 .[dev,ci]
5554
'
5655

Diff for: .github/workflows/push.yml

+14-35
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
os:
2323
- 'ubuntu-latest'
2424
- 'windows-latest'
25-
- 'macOs-latest'
25+
- 'macos-latest'
2626
architecture:
2727
- 'x64'
2828
- 'x86'
@@ -31,7 +31,7 @@ jobs:
3131
exclude:
3232
- os: ubuntu-latest
3333
architecture: 'x86'
34-
- os: macOs-latest
34+
- os: macos-latest
3535
architecture: 'x86'
3636
- os: windows-latest
3737
architecture: 'x86'
@@ -60,51 +60,30 @@ jobs:
6060
distribution: 'temurin'
6161
architecture: ${{ matrix.architecture }}
6262

63-
- name: install-windows
64-
if: matrix.os == 'windows-latest'
65-
run: |
66-
"%VS140COMNTOOLS%../../VC/vcvarsall.bat"
67-
echo "$INCLUDE"
68-
set INCLUDE "C:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt"
69-
pip install --timeout=120 -U setuptools cython
70-
pip install --timeout=120 -vv .[dev,ci]
63+
- name: (macOS) Setup test dependencies
64+
if: matrix.os == 'macos-latest'
65+
run: brew install ant
7166

72-
- name: install
73-
if: matrix.os == 'ubuntu-latest'
74-
run: |
75-
pip install --timeout=120 -U setuptools cython
76-
pip install --timeout=120 .[dev,ci]
67+
- name: Build test classes via ant
68+
run: ant all
7769

78-
- name: install-osx
79-
if: matrix.os == 'macOs-latest'
70+
- name: Install pyjnius with [dev, ci] extras
8071
run: |
81-
brew install ant
82-
pip install --timeout=120 --user -U setuptools cython
83-
pip install --timeout=120 --user .[dev,ci]
84-
85-
- name: test-windows
72+
pip install --timeout=120 .[dev,ci]
73+
74+
- name: (Windows) Test pyjnius via pytest
8675
if: matrix.os == 'windows-latest'
8776
run: |
8877
$env:PATH +=";$env:JAVA_HOME\jre\bin\server\;$env:JAVA_HOME\jre\bin\client\;$env:JAVA_HOME\bin\server\"
8978
$env:CLASSPATH ="../build/test-classes;../build/classes"
90-
91-
ant all
9279
cd tests
9380
pytest -v
9481
95-
- name: test
96-
if: matrix.os == 'ubuntu-latest'
97-
run: |
98-
ant all
99-
cd tests
100-
CLASSPATH=../build/test-classes:../build/classes pytest -v
101-
102-
- name: test
103-
if: matrix.os == 'macOs-latest'
82+
- name: (Linux, macOS) Test pyjnius via pytest
83+
if: (matrix.os == 'ubuntu-latest') || (matrix.os == 'macos-latest')
10484
run: |
105-
ant all
10685
cd tests
107-
CLASSPATH=../build/test-classes:../build/classes python -m pytest -v
86+
CLASSPATH=../build/test-classes:../build/classes python -m pytest -v
10887
10988
# - name: coveralls
11089
# run: python -m coveralls

Diff for: pyproject.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[build-system]
2-
requires = ["setuptools", "wheel", "Cython"]
2+
requires = [
3+
"setuptools>=58.0.0",
4+
"wheel",
5+
"Cython>=0.29.30"
6+
]

Diff for: setup.cfg

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[options]
2+
install_requires =
3+
six>=1.7.0
4+
5+
[options.extras_require]
6+
dev =
7+
pytest
8+
pytest-cov
9+
pycodestyle
10+
ci =
11+
coveralls
12+
pytest-rerunfailures

Diff for: setup.py

+3-15
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
import subprocess
1212

1313
from os import environ
14-
from os.path import dirname, join, exists
15-
import re
14+
from os.path import dirname, join
1615
import sys
17-
from platform import machine
1816
from setup_sdist import SETUP_KWARGS
1917

2018
# XXX hack to be able to import jnius.env withough having build
@@ -56,19 +54,15 @@ def getenv(key):
5654
]
5755

5856
EXTRA_LINK_ARGS = []
59-
INSTALL_REQUIRES = ['six>=1.7.0']
60-
SETUP_REQUIRES = []
6157

6258
# detect Python for android
6359
PLATFORM = sys.platform
6460
NDKPLATFORM = getenv('NDKPLATFORM')
6561
if NDKPLATFORM is not None and getenv('LIBLINK'):
6662
PLATFORM = 'android'
6763

68-
# detect cython
69-
if PLATFORM != 'android':
70-
SETUP_REQUIRES.append('cython')
71-
else:
64+
# detect platform
65+
if PLATFORM == 'android':
7266
FILES = [fn[:-3] + 'c' for fn in FILES if fn.endswith('pyx')]
7367

7468
JAVA=get_java_setup(PLATFORM)
@@ -118,12 +112,6 @@ def compile_native_invocation_handler(java):
118112
# create the extension
119113
setup(
120114
cmdclass={'build_ext': build_ext},
121-
install_requires=INSTALL_REQUIRES,
122-
setup_requires=SETUP_REQUIRES,
123115
ext_modules=ext_modules,
124-
extras_require={
125-
'dev': ['pytest', 'wheel', 'pytest-cov', 'pycodestyle'],
126-
'ci': ['coveralls', 'pytest-rerunfailures', 'setuptools>=34.4.0'],
127-
},
128116
**SETUP_KWARGS
129117
)

0 commit comments

Comments
 (0)