diff --git a/.github/images/bigendian.Dockerfile b/.github/images/bigendian.Dockerfile index 1fe895681..41e5f8f86 100644 --- a/.github/images/bigendian.Dockerfile +++ b/.github/images/bigendian.Dockerfile @@ -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 diff --git a/.github/workflows/analyzers.yaml b/.github/workflows/analyzers.yaml index 50340a300..8f1957d86 100644 --- a/.github/workflows/analyzers.yaml +++ b/.github/workflows/analyzers.yaml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: cppcheck: diff --git a/.github/workflows/bigendian.yaml b/.github/workflows/bigendian.yaml index 9670fb935..7a4206861 100644 --- a/.github/workflows/bigendian.yaml +++ b/.github/workflows/bigendian.yaml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: bigendian: diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml index e2e62529f..2ac9aa300 100644 --- a/.github/workflows/core.yaml +++ b/.github/workflows/core.yaml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: build_core: diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index bfb9d5e80..b97bba824 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -5,6 +5,7 @@ on: branches: [master] pull_request: branches: [master] + workflow_dispatch: jobs: build_docs: diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index e4150e48e..30ad81efa 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -7,6 +7,7 @@ on: - '*' pull_request: branches: [master] + workflow_dispatch: jobs: wheels: @@ -31,6 +32,8 @@ jobs: arch: i686 - os: macos-11 arch: x86_64 + - os: macos-13-xlarge + arch: arm64 steps: - name: Disable autocrlf @@ -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/ diff --git a/README.md b/README.md index 7c21a05d7..05da7cac6 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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. diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..fae264fe7 --- /dev/null +++ b/SECURITY.md @@ -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. diff --git a/python/dlisio/__init__.py b/python/dlisio/__init__.py index 7f4626fc9..3b02b06d4 100644 --- a/python/dlisio/__init__.py +++ b/python/dlisio/__init__.py @@ -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 diff --git a/python/pyproject.toml b/python/pyproject.toml index cd0b70ce8..2f6bc6795 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -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 \ + """, +]