Skip to content

Commit

Permalink
Merge pull request #151 from vincentcasseau/main
Browse files Browse the repository at this point in the history
Publish to PyPI - v1
  • Loading branch information
vincentcasseau authored Aug 30, 2024
2 parents e0b5ad9 + 64522dd commit 0860c13
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:
tags:
- 'v*'
# branches:
# - 'main'
branches:
- 'main'

jobs:
docker:
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: publish PyPI

on:
push:
tags:
- 'v*'
branches:
- 'main'

jobs:
build:
runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.8", "3.12"]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
# python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
gcc \
g++ \
gfortran \
libopenmpi-dev \
libhdf5-openmpi-dev \
python3-tk \
mesa-common-dev \
libgl1-mesa-dev \
libglu1-mesa-dev \
libosmesa6-dev \
xorg-dev
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install wheel setuptools scons numpy mpi4py
- name: Verify Python and Installed Packages
run: |
python --version
python -m pip list
- name: Build Cassiopee package
run: |
export CASSIOPEE=$GITHUB_WORKSPACE
export MACHINE=ubuntu
. $CASSIOPEE/Cassiopee/Envs/sh_Cassiopee_r8
cd $CASSIOPEE/Cassiopee
echo -e "FREEMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FREEMODULES\nFULLMODULES='KCore XCore Converter Geom Transform Generator Post Initiator Connector Distributor2 Dist2Walls RigidMotion Compressor Modeler Intersector Apps CPlot'\nexport FULLMODULES\nOTHERS=''" > $CASSIOPEE/Cassiopee/MODULES
echo "PATH: $PATH"
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"
echo "PYTHONPATH: $PYTHONPATH"
./install
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: find -name "*.whl" -exec twine upload {} +

# publish:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.12"
#
# - name: Publish to PyPI
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: find -name "*.whl" -exec twine upload {} +
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,31 @@ requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2", "scons>=3"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_scheme = "post-release"
local_scheme = "node-and-date"

[project]
name = "Cassiopee"
authors = [
{ name="ONERA", email="christophe.benoit@onera.fr" },
]
license = {text="GPLv3"}
description = "Computational Fluid Dynamics pre- and post-processing python modules"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"numpy",
"mpi4py",
"scons"
]
classifiers = [
"Programming Language :: Python",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: Unix",
"Operating System :: Microsoft :: Windows",
"Topic :: Scientific/Engineering :: Physics"
]

[project.urls]
Homepage = "https://github.com/onera/Cassiopee"
Issues = "https://github.com/onera/Cassiopee/issues"

0 comments on commit 0860c13

Please sign in to comment.