Skip to content

Commit

Permalink
Merge pull request #31 from static-frame/30/py312
Browse files Browse the repository at this point in the history
  • Loading branch information
flexatone authored Dec 17, 2023
2 parents 9bb6e4f + 5d31d88 commit e81f66b
Show file tree
Hide file tree
Showing 13 changed files with 136 additions and 47 deletions.
18 changes: 18 additions & 0 deletions .github/problem-matchers/gcc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "gcc-problem-matcher",
"pattern": [
{
"regexp": "^\\s*(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*?(?:\\s+\\[(.*)\\])?)\\s*$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
18 changes: 18 additions & 0 deletions .github/problem-matchers/msvc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "msvc-problem-matcher",
"pattern": [
{
"regexp": "^\\s*(?:\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning)\\s+((\\w+\\d+)\\s*:\\s*.*?)\\s*$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
"code": 6
}
]
}
]
}
117 changes: 84 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,92 +12,143 @@ on:
jobs:
tar_gz:
name: Package
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@master
- uses: actions/setup-python@master
with:
python-version: 3.12
- run: pip install -r requirements-build-3_12.txt
- run: python setup.py sdist
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

whl_lt_3_9:
matrix_config:
name: Matrix Runner Config
runs-on: ubuntu-22.04
outputs:
matrix_os: ${{ steps.step.outputs.matrix_os }}
steps:
- run: echo "$GITHUB_EVENT_NAME"
- id: step
run: |
if [ "$GITHUB_EVENT_NAME" = "release" ]; then
echo 'matrix_os=["macos-13-xlarge", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
else
echo 'matrix_os=["macos-13", "ubuntu-22.04", "windows-2022"]' >> $GITHUB_OUTPUT
fi
whl_3_8:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: [macos-12, ubuntu-22.04, windows-2022]
minor: [7, 8]
os: ${{ fromJson(needs.matrix_config.outputs.matrix_os) }}
minor: [8]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pypa/[email protected]
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')

- run: pip install pipx # only for macos amd64
if: startsWith(matrix.os, 'macos-')

- uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_ARCHS_MACOS: all
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-backward.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-backward.txt
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_08.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_08.txt
CIBW_TEST_COMMAND: pytest {project}

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

whl_gte_3_9:
whl_gte_3_9_to_3_11:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: [macos-12, ubuntu-22.04, windows-2022]
os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}}
minor: [9, 10, 11]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pypa/[email protected]
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')

- run: pip install pipx
if: startsWith(matrix.os, 'macos-')

- uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_ARCHS_MACOS: all
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test.txt
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_11.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_11.txt
CIBW_TEST_COMMAND: pytest {project}

- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

forward:
name: Forward / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
whl_3_12:
name: Build / ${{ matrix.os }} / Python 3.${{ matrix.minor }}
needs: matrix_config
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04]
minor: [11]
os: ${{fromJson(needs.matrix_config.outputs.matrix_os)}}
minor: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pypa/[email protected]
- uses: actions/checkout@master
- uses: actions/setup-python@master
- run: echo '::add-matcher::.github/problem-matchers/gcc.json'
if: startsWith(matrix.os, 'macos-') || startsWith(matrix.os, 'ubuntu-')
- run: echo '::add-matcher::.github/problem-matchers/msvc.json'
if: startsWith(matrix.os, 'windows-')

- run: pip install pipx # only for macos amd64
if: startsWith(matrix.os, 'macos-')

- uses: pypa/[email protected]
with:
output-dir: dist
env:
CIBW_BUILD: cp3${{ matrix.minor }}-*
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-test-forward.txt
CIBW_ARCHS_WINDOWS: x86 AMD64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_BEFORE_BUILD: pip install -r {project}/requirements-build-3_12.txt
CIBW_BEFORE_TEST: pip install -r {project}/requirements-dev-3_12.txt
CIBW_TEST_COMMAND: pytest {project}
- uses: actions/upload-artifact@v3
with:
name: dist
path: dist

upload:
name: Publish
if: github.event_name == 'release' && github.event.action == 'published'
needs: [tar_gz, whl_lt_3_9, whl_gte_3_9, forward]
if: github.event_name == 'release'
needs: [tar_gz, whl_3_8, whl_gte_3_9_to_3_11, whl_3_12]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Dependencies

ArrayMap requires the following:

- Python >= 3.7
- Python >= 3.8
- NumPy >= 1.18.5


Expand Down
1 change: 1 addition & 0 deletions requirements-build-3_08.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
numpy==1.19.5
File renamed without changes.
2 changes: 2 additions & 0 deletions requirements-build-3_12.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
numpy==1.26.2
setuptools==69.*
1 change: 0 additions & 1 deletion requirements-build-backward.txt

This file was deleted.

3 changes: 2 additions & 1 deletion requirements-test-forward.txt → requirements-dev-3_08.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
numpy==1.24.3
tzdata==2022.1
numpy==1.19.5
3 changes: 2 additions & 1 deletion requirements-test-backward.txt → requirements-dev-3_11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
pytest==7.1.2
numpy==1.18.5
tzdata==2022.1
numpy==1.23.5
5 changes: 3 additions & 2 deletions requirements-test.txt → requirements-dev-3_12.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
black==22.3.0
hypothesis==6.70.0
invoke==1.7.1
invoke==2.2.0
pytest==7.1.2
numpy==1.23.5
tzdata==2022.1
numpy==1.26.2
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
numpy==1.23.5
numpy>=1.19.5

10 changes: 3 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

AM_VERSION = "0.1.9"


with open("README.rst") as file:
LONG_DESCRIPTION = file.read()


def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
dirs = []
for sp in site.getsitepackages():
Expand All @@ -19,7 +17,6 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
dirs.append(fp)
return dirs


extension = setuptools.Extension(
"arraymap",
["arraymap.c"],
Expand All @@ -29,14 +26,13 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
libraries=["npymath"],
)


setuptools.setup(
name="arraymap",
version=AM_VERSION,
description="Dictionary-like lookup from NumPy array values to their integer positions",
long_description=LONG_DESCRIPTION,
python_requires=">=3.7.0",
install_requires=["numpy>=1.18.5"],
python_requires=">=3.8.0",
install_requires=["numpy>=1.19.5"],
url="https://github.com/static-frame/arraymap",
author="Christopher Ariza, Brandt Bucher",
license="MIT",
Expand All @@ -48,11 +44,11 @@ def get_ext_dir(*components: tp.Iterable[str]) -> tp.Sequence[str]:
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
ext_modules=[extension],
)

0 comments on commit e81f66b

Please sign in to comment.