-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3960 from ornladios/add-pip-packaging
Add pip packaging
- Loading branch information
Showing
14 changed files
with
341 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
name: Python Packaging | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
overrideVersion: | ||
description: Manually force a version | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- release_[0-9]+ | ||
tags: | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
release: | ||
types: | ||
- published | ||
|
||
env: | ||
ADIOS2_CUSTOM_VERSION_OVERRIDE: ${{ github.event.inputs.overrideVersion }} | ||
|
||
jobs: | ||
make_sdist: | ||
name: Make SDist | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate common version file | ||
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT | ||
|
||
- name: Build SDist | ||
run: pipx run build --sdist | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Wheel on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# os: [ubuntu-latest, windows-latest, macos-latest] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Generate common version file | ||
run: cmake -P scripts/ci/gh-actions/config/adios-version.cmake && echo VERSION.TXT | ||
|
||
- uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: cp*-manylinux_x86_64 | ||
|
||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/*.whl | ||
|
||
upload_pypi: | ||
needs: [build_wheels, make_sdist] | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
upload_test_pypi: | ||
needs: [build_wheels, make_sdist] | ||
environment: testpypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
# Upload to Test PyPI for every commit on main branch | ||
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: Publish package distributions to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
[![GitHub (pre-)release](https://img.shields.io/github/release/ornladios/adios2/all.svg)]() | ||
[![Spack Version](https://img.shields.io/spack/v/adios2.svg)](https://spack.readthedocs.io/en/latest/package_list.html#adios2) | ||
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/adios2)](https://anaconda.org/conda-forge/adios2) | ||
[![PyPI version](https://badge.fury.io/py/adios2.svg)](https://badge.fury.io/py/adios2) | ||
|
||
[![Circle CI](https://circleci.com/gh/ornladios/ADIOS2.svg?style=shield)](https://circleci.com/gh/ornladios/ADIOS2) | ||
|
||
|
@@ -23,7 +24,7 @@ ADIOS2 can be used on supercomputers, cloud systems, and personal computers. | |
ADIOS2 focuses on: | ||
|
||
1. **Performance** I/O scalability in high performance computing (HPC) applications. | ||
2. **Adaptability** unified interfaces to allow for several modes of transport (files, memory-to-memory) | ||
2. **Adaptability** unified interfaces to allow for several modes of transport (files, memory-to-memory) | ||
3. **Ease of Use** two-level application programming interface (APIs) | ||
* Full APIs for HPC applications: C++11, Fortran 90, C 99, Python 2 and 3 | ||
* Simplified High-Level APIs for data analysis: Python 2 and 3, C++11, Matlab | ||
|
@@ -63,7 +64,7 @@ For a `cmake` configuration example see [scripts/runconf/runconf.sh](https://git | |
* Docker images: under [scripts/docker](https://github.com/ornladios/ADIOS2/tree/master/scripts/docker) | ||
|
||
|
||
Once ADIOS2 is installed refer to: | ||
Once ADIOS2 is installed refer to: | ||
|
||
* [Linking ADIOS2](https://adios2.readthedocs.io/en/latest/setting_up/setting_up.html#linking-adios-2) | ||
|
||
|
@@ -78,7 +79,7 @@ Once ADIOS2 is installed refer to: | |
|
||
ADIOS2 is an open source project: Questions, discussion, and contributions are welcome. Join us at: | ||
|
||
- Mailing list: [email protected] | ||
- Mailing list: [email protected] | ||
- Github Discussions: https://github.com/ornladios/ADIOS2/discussions | ||
|
||
## Reporting Bugs | ||
|
@@ -103,7 +104,7 @@ See the accompanying [Copyright.txt](Copyright.txt) for more details. | |
|
||
* scripts - Project maintenance and development scripts | ||
|
||
* source - Internal source code for private components | ||
* source - Internal source code for private components | ||
* adios2 - source directory for the ADIOS2 library to be installed under install-dir/lib/libadios2. | ||
* utils - source directory for the binary utilities, to be installed under install-dir/bin | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import adios2 | ||
|
||
import sys | ||
import unittest | ||
|
||
|
||
DATA_FILENAME = "hello-world-py.bp" | ||
|
||
class TestSimpleReadWrite(unittest.TestCase): | ||
|
||
def _write(self, ad, greeting): | ||
"""write a string to a bp file""" | ||
io = ad.DeclareIO("hello-world-writer") | ||
var_greeting = io.DefineVariable("Greeting") | ||
w = io.Open(DATA_FILENAME, adios2.Mode.Write) | ||
w.BeginStep() | ||
w.Put(var_greeting, greeting) | ||
w.EndStep() | ||
w.Close() | ||
return 0 | ||
|
||
def _read(self, ad): | ||
"""read a string from to a bp file""" | ||
io = ad.DeclareIO("hello-world-reader") | ||
r = io.Open(DATA_FILENAME, adios2.Mode.Read) | ||
r.BeginStep() | ||
var_greeting = io.InquireVariable("Greeting") | ||
message = r.Get(var_greeting) | ||
r.EndStep() | ||
r.Close() | ||
return message | ||
|
||
def test_simple_read_write(self): | ||
"""driver function""" | ||
print("ADIOS2 version {0}".format(adios2.__version__)) | ||
ad = adios2.ADIOS() | ||
greeting = "Hello World from ADIOS2" | ||
self._write(ad, greeting) | ||
message = self._read(ad) | ||
print("{}".format(message)) | ||
self.assertEqual(greeting, message) | ||
return 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
[build-system] | ||
requires = ["scikit-build-core", "numpy", "setuptools_scm>=8"] | ||
build-backend = "scikit_build_core.build" | ||
|
||
[project] | ||
name = "adios2" | ||
dynamic = ["version"] | ||
authors = [ | ||
{ name="Caitlin Ross", email="[email protected]" }, | ||
{ name="Chuck Atkins", email="[email protected]" }, | ||
{ name="Greg S. Eisenhauer", email="[email protected]" }, | ||
{ name="Junmin Gu", email="[email protected]" }, | ||
{ name="Norbert Podhorszki", email="[email protected]" }, | ||
{ name="Ruonan (Jason) Wang", email="[email protected]" }, | ||
{ name="Scott Wittenburg", email="[email protected]" }, | ||
{ name="Spiros Tsalikis", email="[email protected]" }, | ||
{ name="V. A. Bolea Sanchez", email="[email protected]" }, | ||
{ name="William F. Godoy", email="[email protected]" }, | ||
] | ||
description = "The Adaptable Input Output System version 2" | ||
readme = "ReadMe.md" | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Programming Language :: C++", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = [ | ||
"numpy", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/ornladios/adios2" | ||
Documentation = "https://adios2.readthedocs.io/" | ||
"Bug Tracker" = "https://github.com/ornladios/adios2/issues" | ||
Discussions = "https://github.com/ornladios/ADIOS2/discussions" | ||
Changelog = "https://github.com/ornladios/ADIOS2/releases" | ||
|
||
[tool.cibuildwheel] | ||
# Trigger an install of the package, and run a basic test | ||
test-command = "python -m unittest adios2.test.simple_read_write.TestSimpleReadWrite" | ||
|
||
[tool.scikit-build] | ||
wheel.packages = ["adios2"] | ||
|
||
[tool.scikit-build.metadata.version] | ||
provider = "scikit_build_core.metadata.regex" | ||
input = "VERSION.TXT" | ||
regex = "^(?P<value>.+?)$" | ||
|
||
[tool.scikit-build.cmake.define] | ||
ADIOS2_USE_PIP = "ON" | ||
ADIOS2_USE_Python = "ON" | ||
ADIOS2_USE_Fortran = "OFF" | ||
ADIOS2_USE_MPI = "OFF" | ||
ADIOS2_USE_HDF5 = "OFF" | ||
ADIOS2_USE_HDF5_VOL = "OFF" | ||
ADIOS2_USE_BZip2 = "OFF" | ||
ADIOS2_USE_Blosc2 = "OFF" | ||
ADIOS2_USE_DataMan = "OFF" | ||
ADIOS2_USE_SZ = "OFF" | ||
ADIOS2_USE_ZeroMQ = "OFF" | ||
ADIOS2_USE_ZFP = "OFF" | ||
BUILD_TESTING = "OFF" | ||
ADIOS2_INSTALL_GENERATE_CONFIG = "OFF" |
Oops, something went wrong.