Skip to content

Commit

Permalink
Merge pull request #429 from achaikou/ci_and_wheels_and_scm
Browse files Browse the repository at this point in the history
Fix CI, add wheels, adjust for SCM policy
  • Loading branch information
achaikou authored Nov 2, 2023
2 parents a1f5695 + 73ddb81 commit a773195
Show file tree
Hide file tree
Showing 10 changed files with 139 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/images/bigendian.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM s390x/debian
RUN apt-get update
RUN apt-get install -y cmake g++ python3 python3-pip git python3-venv
RUN apt-get install -y cmake g++ python3 python3-pip git python3-venv libopenblas-dev

#mpark variant
WORKDIR /home/ci
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/analyzers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
cppcheck:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/bigendian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
bigendian:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build_core:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

jobs:
build_docs:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- '*'
pull_request:
branches: [master]
workflow_dispatch:

jobs:
wheels:
Expand All @@ -31,6 +32,8 @@ jobs:
arch: i686
- os: macos-11
arch: x86_64
- os: macos-13-xlarge
arch: arm64

steps:
- name: Disable autocrlf
Expand Down Expand Up @@ -62,7 +65,10 @@ jobs:
CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;C:/Program Files (x86)/layered-file-protocols/"
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_SKIP: pp* *-musllinux_* cp31*-win32 cp312-*
# musllinux arch skip: unlikely someone wants to run dlisio on alpine on non-standard architecture
# musllinux cp37 and cp38 skip: latest available numpy doesn't provide musslinux wheels, so it is unlikely useful
# macosx 38 skip: cibuildwheel can't test it
CIBW_SKIP: pp* *-musllinux_i686 *-musllinux_aarch64 cp37*-musllinux* cp38*-musllinux* cp38*-macosx_*:arm64 cp36-*

run: |
python -m cibuildwheel --output-dir wheelhouse python/
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ pip install dlisio
```


| | macOS Intel | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux aarch64 |
|---------------|----|-----|-----|----|----|
| CPython 3.6 ||| |||
| CPython 3.7 ||| |||
| CPython 3.8 ||||||
| CPython 3.9 ||||||
| CPython 3.10 ||| - |||
| CPython 3.11 ||| - |||
| | macOS Intel | macOS ARM | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux aarch64 | manylinux i686 | musllinux x86_64
|---------------|----|-----|-----|----|----|----|----|----|
| CPython 3.7 || - | |||| | - |
| CPython 3.8 || - | |||| | - |
| CPython 3.9 ||| ||| |||
| CPython 3.10 || |||| |||
| CPython 3.11 ||| ||| |||
| CPython 3.12 ||| ||| |||

See [Build dlisio](#Build-dlisio) for building dlisio from source.

Expand Down Expand Up @@ -97,7 +97,7 @@ To develop dlisio, or to build a particular revision from source, you need:

* A C++11 compatible compiler (tested on gcc, clang, and msvc 2019)
* [CMake](https://cmake.org/) version 3.5 or greater
* [Python](https://python.org) version 3.6 or greater
* [Python](https://python.org) version 3.7 or greater
* [fmtlib](http://fmtlib.net/) tested mainly with 7.1.3
* [mpark_variant](https://github.com/mpark/variant)
* [pybind11](https://github.com/pybind/pybind11) version 2.6 or greater
Expand Down Expand Up @@ -137,8 +137,6 @@ By default, the python library is built.

## Contributing ##

We welcome all kinds of contributions, including code, bug reports, issues,
feature requests, and documentation. The preferred way of submitting a
contribution is to either make an
[issue](https://github.com/equinor/dlisio/issues) on github or by forking the
project on github and making a pull request.
We welcome all kinds of contributions, including bug reports, issues, feature
requests and documentation. The preferred way of submitting a contribution is to
make an [issue](https://github.com/equinor/dlisio/issues) on github.
18 changes: 18 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## SECURITY ##

If you discover a security vulnerability in this project, please follow these steps to responsibly disclose it:

1. **Do not** create a public GitHub issue for the vulnerability.
2. Follow our guideline for Responsible Disclosure Policy at [https://www.equinor.com/about-us/csirt](https://www.equinor.com/about-us/csirt) to report the issue

The following information will help us triage your report more quickly:

- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
- Full paths of source file(s) related to the manifestation of the issue
- The location of the affected source code (tag/branch/commit or direct URL)
- Any special configuration required to reproduce the issue
- Step-by-step instructions to reproduce the issue
- Proof-of-concept or exploit code (if possible)
- Impact of the issue, including how an attacker might exploit the issue

We prefer all communications to be in English.
20 changes: 15 additions & 5 deletions python/dlisio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@
from . import lis
from . import dlis

try:
import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
pass
import sys

# remove else once support for python 3.7 is over
if sys.version_info >= (3, 8):
try:
import importlib.metadata
__version__ = importlib.metadata.version(__name__)
except importlib.metadata.PackageNotFoundError:
pass
else:
try:
import pkg_resources
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
pass
85 changes: 82 additions & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,90 @@ test-command = [
]

[tool.cibuildwheel.linux]
manylinux-x86_64-image = "manylinux2010"
manylinux-x86_64-image = "manylinux2014"

[[tool.cibuildwheel.overrides]]
select = "cp311*"
manylinux-x86_64-image = "manylinux2014"
select = "cp3{9,10,11,12}*i686"
before-build= [
"python -m pip install numpy --config-settings=setup-args=\"-Dallow-noblas=true\" ",
"""cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON=OFF \
""",
"""cmake \
--build build \
--parallel \
--target install \
--config Release \
""",
]

[tool.cibuildwheel.macos]
environment = { CXXFLAGS="-L/usr/local/lib" }

before-all = [
"""curl \
-L https://github.com/fmtlib/fmt/archive/refs/tags/7.1.3.tar.gz \
-o fmt-7.1.3.tar.gz \
""",
"tar xf fmt-7.1.3.tar.gz",
"""cmake \
-S fmt-7.1.3 \
-B fmt-7.1.3/build \
-DFMT_TEST=OFF \
-DFMT_DOC=OFF \
""",
"""sudo cmake \
--build fmt-7.1.3/build \
--target install \
--config Release \
""",
"""git clone https://github.com/equinor/layered-file-protocols.git""",
"""cmake \
-S layered-file-protocols \
-B layered-file-protocols/build \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLFP_FMT_HEADER_ONLY=ON \
-DBUILD_TESTING=OFF \
""",
"""sudo cmake \
--build layered-file-protocols/build \
--target install \
--config Release \
""",
"""curl \
-L https://github.com/mpark/variant/archive/refs/tags/v1.4.0.tar.gz \
-o variant-1.4.0.tar.gz \
""",
"tar xf variant-1.4.0.tar.gz",
"""cmake \
-S variant-1.4.0 \
-B variant-1.4.0/build \
""",
"""sudo cmake \
--build variant-1.4.0/build \
--target install \
--config Release \
""",
]

before-build = [
"""cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_TESTING=OFF \
-DBUILD_PYTHON=OFF \
""",
"""sudo cmake \
--build build \
--parallel \
--target install \
--config Release \
""",
]

0 comments on commit a773195

Please sign in to comment.