Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hosting of built wheel at PyPI - develop #298

Merged
merged 74 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
e089c4f
Merge pull request #289 from ImperialCollegeLondon/develop
kccwing May 10, 2024
3df4cb2
Update CHANGELOG.md for version 2.3
ben-l-p May 10, 2024
9b42785
Change version in installation guide
ben-l-p May 10, 2024
e685865
Updated docs to address issue with conda install failing
ben-l-p Jun 10, 2024
66b9390
Merge pull request #290 from ImperialCollegeLondon/fix_conda_killed
rafapalacios Jun 10, 2024
ae2ee88
Lower NumPy and SciPy version for install
ben-l-p Jun 25, 2024
e19f74e
Merge pull request #292 from ImperialCollegeLondon/fix_prevent_numpy2
rafapalacios Jun 27, 2024
dbd1143
Create pypi_test.yaml
kccwing Aug 28, 2024
cf348f0
Update pypi_test.yaml
kccwing Aug 28, 2024
586d3ac
Update pypi_test.yaml
kccwing Aug 28, 2024
f45ac04
Update pypi_test.yaml
kccwing Aug 28, 2024
2396379
Update pypi_test.yaml
kccwing Aug 28, 2024
8db99ca
Update pypi_test.yaml
kccwing Aug 28, 2024
88ec407
Update pypi_test.yaml
kccwing Aug 28, 2024
56b0950
Update pypi_test.yaml
kccwing Aug 28, 2024
088cc08
Update pypi_test.yaml
kccwing Aug 28, 2024
3deb0dd
Update pypi_test.yaml
kccwing Aug 28, 2024
e96d862
Update pypi_test.yaml
kccwing Aug 28, 2024
7418a8d
Update pypi_test.yaml
kccwing Aug 28, 2024
0add8ca
Update pypi_test.yaml
kccwing Aug 28, 2024
97ed0e0
Update pypi_test.yaml
kccwing Aug 28, 2024
5a40812
Update pypi_test.yaml
kccwing Aug 28, 2024
d5d129b
Update pypi_test.yaml
kccwing Aug 28, 2024
442e417
Update setup.py
kccwing Aug 28, 2024
047ff09
Update setup.py
kccwing Aug 28, 2024
ebb6b4e
Update pypi_test.yaml
kccwing Aug 28, 2024
1132cb2
Update setup.py
kccwing Aug 28, 2024
5372e3b
Update pypi_test.yaml
kccwing Aug 28, 2024
09a9879
Update pypi_test.yaml
kccwing Aug 28, 2024
3ea2da1
Update pypi_test.yaml
kccwing Aug 28, 2024
49bf8d2
Update pypi_test.yaml
kccwing Aug 28, 2024
8f73f16
Update pypi_test.yaml
kccwing Aug 28, 2024
bf674a4
Update pypi_test.yaml
kccwing Aug 28, 2024
0d3edd7
Update pypi_test.yaml
kccwing Aug 28, 2024
2ecb365
Update pypi_test.yaml
kccwing Aug 28, 2024
7e52ca1
Update setup.py
kccwing Aug 28, 2024
cfc187a
change name of package
kccwing Aug 28, 2024
4a15277
mayavi direct dependency removed
kccwing Aug 28, 2024
951f920
Create pypi_build.yaml
kccwing Aug 28, 2024
2971617
Update and rename pypi_test.yaml to pypi_build_test.yaml
kccwing Aug 28, 2024
64ba76f
Update pypi_build_test.yaml
kccwing Aug 28, 2024
5a78562
Update pypi_build_test.yaml
kccwing Aug 29, 2024
560911d
Update pypi_build.yaml
kccwing Aug 29, 2024
348bfe7
Update readme.md for pypi
kccwing Aug 29, 2024
0b229f9
Update readme.md
kccwing Aug 29, 2024
a4be887
Update installation.md for PyPI
kccwing Aug 29, 2024
389baba
Update installation.md
kccwing Aug 29, 2024
fe44484
Update pypi_build_test.yaml
kccwing Aug 29, 2024
f850fec
Addressed and incorporated suggestions from review
kccwing Aug 29, 2024
acb41ff
Deleted as now incorporated into pypi_build
kccwing Aug 29, 2024
ae491be
Update pypi_build.yaml
kccwing Aug 29, 2024
107e467
Update pypi_build.yaml
kccwing Aug 29, 2024
b054baf
Update pypi_build.yaml
kccwing Aug 29, 2024
0b4ea11
Update pypi_build.yaml
kccwing Aug 29, 2024
e20210f
Update pypi_build.yaml
kccwing Aug 29, 2024
b8704e3
Renamed job to distinguish actions
kccwing Aug 29, 2024
9210c61
Name update for readability
kccwing Aug 29, 2024
41a04a8
Update readme.md for removing pypi_test
kccwing Aug 29, 2024
98853a1
Add rewritten aeroforcescalculator.py using flow angle rotation
ben-l-p Sep 26, 2024
faf5126
Fixed FoR issue with aero forces
ben-l-p Sep 27, 2024
86b8013
Removed commented code in AeroForcesCalculator
ben-l-p Sep 27, 2024
e231805
Merge pull request #301 from ImperialCollegeLondon/fix_aeroforces_for
ben-l-p Oct 5, 2024
c571ec9
include also tarball to pypi
kccwing Oct 7, 2024
8bd521f
update upload/download-artifact to v4
kccwing Oct 7, 2024
cdd24b6
use older gcc version to improve compatibility
kccwing Oct 7, 2024
5ecf279
update gcc action to 4.8
kccwing Oct 7, 2024
bfdba81
Update pypi_build.yaml
kccwing Oct 7, 2024
1ec190a
ubuntu bionic runner deprecated
kccwing Oct 7, 2024
904e247
Merge branch 'develop' into dev_pypi
kccwing Oct 8, 2024
923bbc6
Merge branch 'main' into dev_pypi
kccwing Oct 8, 2024
70bcd19
renaming pypi repo to be consistent with documentation
kccwing Oct 9, 2024
45ae5e5
pypi rename to ic-sharpy
kccwing Oct 9, 2024
ddbf96c
pypi rename to ic-sharpy
kccwing Oct 9, 2024
1c06e20
pypi rename to ic-sharpy
kccwing Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/pypi_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Create and publish pypi image

on:
# only runs when there are pushes to develop and main for publishing
# and for testing, pull requests to develop and main
# and if there are changes to the build process and github action
push:
branches:
- develop
- main
paths:
- 'setup.py'
- '.github/workflows/pypi*'
pull_request:
branches:
- main
- develop
- 'rc*'

jobs:
create-pypi-image:
name: >-
Create .whl 🛞 from SHARPy distribution
runs-on: ubuntu-20.04
env:
python-version-chosen: "3.10.8"
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ env.python-version-chosen }}
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version-chosen }}
- name: Set up GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 7
platform: x64
- name: Pre-Install dependencies
run: |
export QT_QPA_PLATFORM='offscreen'
sudo apt install libeigen3-dev
git submodule init
git submodule update
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Install wheel
run: python3 -m pip install wheel --user
- name: Build a source tarball
run: python setup.py sdist
- name: Build a binary wheel
run: python3 setup.py bdist_wheel
- name: Find the wheel created during pip install
run:
python3 -m pip cache dir
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/v') # only publish to PyPI on tag pushes
needs:
- create-pypi-image
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ic_sharpy # Replace <package-name> with your PyPI project name
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# with:
# path: dist/*
11 changes: 9 additions & 2 deletions .github/workflows/readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SHARPy GitHub Workflows

There are 4 automated workflows for SHARPy's CI/CD.
There are 4(+1 experimental) automated workflows for SHARPy's CI/CD.

## SHARPy Tests

Expand All @@ -19,5 +19,12 @@ Python code, hence allowing the merge.
Two nearly identical workflows, the only difference is that one pushes the Docker
image to the SHARPy packages. Therefore:

* `docker_build.yaml`: Builds the Docker image but does not push. Runs on changes to the `docker*` workflows, changes to the `utils/` directory (environments) and changes to the `Dockerfile`. Required test for PRs to merge to `develop` and `main`.
* `docker_build_test.yaml`: Builds the Docker image but does not push. Runs on changes to the `docker*` workflows, changes to the `utils/` directory (environments) and changes to the `Dockerfile`. Required test for PRs to merge to `develop` and `main`.
* `docker_build.yaml`: Builds and pushes the Docker image. Runs on pushes to `develop`, `main` and annotated tags.

## Pypi (experimental!)

One workflow with two jobs, the first creates and the second pushes the wheel
artifact to ic-sharpy @ pypi. Therefore:

* `pypi_build.yaml`: Builds and pushes the pypi wheel according to conditions. Runs on changes to the `pypi*` workflow, changes to the `setup.py`, and PRs and pushes to main and develop. Required test for PRs to merge to `develop` and `main`. Publishes on annotated tags.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
# Changelog

## [2.3](https://github.com/imperialcollegelondon/sharpy/tree/2.3) (2024-05-10)

[Full Changelog](https://github.com/imperialcollegelondon/sharpy/compare/2.2...2.3)

**Implemented enhancements:**

- Version 2.3 update [\#289](https://github.com/ImperialCollegeLondon/sharpy/pull/289) ([ben-l-p](https://github.com/ben-l-p))
- Update develop branch with main [\#284](https://github.com/ImperialCollegeLondon/sharpy/pull/284) ([ben-l-p](https://github.com/ben-l-p))
- Added pip install \(with docs\) [\#280](https://github.com/ImperialCollegeLondon/sharpy/pull/280) ([ben-l-p](https://github.com/ben-l-p))
- Update beamplot.py to have stride option, consistent with aerogridplot.py [\#279](https://github.com/ImperialCollegeLondon/sharpy/pull/279) ([kccwing](https://github.com/kccwing))

**Fixed bugs:**

- Fix Github Runner Docker build failing [\#285](https://github.com/ImperialCollegeLondon/sharpy/pull/285) ([ben-l-p](https://github.com/ben-l-p))
- Add scipy version info to env yml [\#277](https://github.com/ImperialCollegeLondon/sharpy/pull/277) ([SJ-Innovation](https://github.com/SJ-Innovation))

**Closed issues:**

- Scipy 1.12.0 Incompatible [\#276](https://github.com/ImperialCollegeLondon/sharpy/issues/276)
- BeamLoader postprocessor squishing answers [\#270](https://github.com/ImperialCollegeLondon/sharpy/issues/270)
- Solving Environment gets killed. [\#268](https://github.com/ImperialCollegeLondon/sharpy/issues/268)
- Error when running sharpy unittest: module scipy.sparse.\_sputils not found [\#227](https://github.com/ImperialCollegeLondon/sharpy/issues/227)
- Potential bug in /sharpy/structure/utils/modalutils.py [\#208](https://github.com/ImperialCollegeLondon/sharpy/issues/208)

**Merged pull requests:**

- Added ability to turn aligned grid off [\#288](https://github.com/ImperialCollegeLondon/sharpy/pull/288) ([ben-l-p](https://github.com/ben-l-p))
- Update with main for mamba fixes [\#286](https://github.com/ImperialCollegeLondon/sharpy/pull/286) ([ben-l-p](https://github.com/ben-l-p))
- Correct typos caught by Divya Sanghi [\#283](https://github.com/ImperialCollegeLondon/sharpy/pull/283) ([bbahiam](https://github.com/bbahiam))
- Develop: Update environment.yml to fix scipy version issue [\#282](https://github.com/ImperialCollegeLondon/sharpy/pull/282) ([kccwing](https://github.com/kccwing))
- Update noaero.py for consistency in function input [\#275](https://github.com/ImperialCollegeLondon/sharpy/pull/275) ([kccwing](https://github.com/kccwing))
- A few minor bug fixes [\#273](https://github.com/ImperialCollegeLondon/sharpy/pull/273) ([sduess](https://github.com/sduess))
- Update XBeam version to include compiler optimisation [\#272](https://github.com/ImperialCollegeLondon/sharpy/pull/272) ([ben-l-p](https://github.com/ben-l-p))
- Update XBeam version to include compiler optimisation [\#271](https://github.com/ImperialCollegeLondon/sharpy/pull/271) ([ben-l-p](https://github.com/ben-l-p))
- Improve docs and code of newmark\_ss [\#267](https://github.com/ImperialCollegeLondon/sharpy/pull/267) ([bbahiam](https://github.com/bbahiam))
- Changed Github runner from Conda to Mamba [\#266](https://github.com/ImperialCollegeLondon/sharpy/pull/266) ([ben-l-p](https://github.com/ben-l-p))
- Changed Github runner from Conda to Mamba [\#265](https://github.com/ImperialCollegeLondon/sharpy/pull/265) ([ben-l-p](https://github.com/ben-l-p))
- Hotfix for documentation search [\#264](https://github.com/ImperialCollegeLondon/sharpy/pull/264) ([kccwing](https://github.com/kccwing))
- Hotfix for documentation - develop [\#263](https://github.com/ImperialCollegeLondon/sharpy/pull/263) ([kccwing](https://github.com/kccwing))
- Hotfix for documentation - main [\#262](https://github.com/ImperialCollegeLondon/sharpy/pull/262) ([kccwing](https://github.com/kccwing))
- Merging v2.2 into develop [\#261](https://github.com/ImperialCollegeLondon/sharpy/pull/261) ([kccwing](https://github.com/kccwing))


## [2.2](https://github.com/imperialcollegelondon/sharpy/tree/2.2) (2023-10-18)

[Full Changelog](https://github.com/imperialcollegelondon/sharpy/compare/2.1...2.2)
Expand Down
32 changes: 28 additions & 4 deletions docs/source/content/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SHARPy v2.2 Installation Guide
__Last revision 26 February 2024__
# SHARPy v2.3 Installation Guide
__Last revision 10 June 2024__

The following step by step tutorial will guide you through the installation process of SHARPy. This is the updated process valid from v2.2.
The following step by step tutorial will guide you through the installation process of SHARPy. This is the updated process valid from v2.3.

## Requirements

Expand Down Expand Up @@ -113,7 +113,17 @@ These are specified in an Anaconda environment that shall be activated prior to
```
This should take approximately 5 minutes to complete (Tested on Ubuntu 22.04.1). For installation on Apple Silicon, use ```environment_arm64.yml```; this requires GCC and GFortran to be installed prior.

5. Activate the `sharpy` conda environment:
Installation using Conda can be memory intensive, and will give the message ```Collecting package metadata (repodata.json): - Killed``` if all the available RAM is filled. From testing, 16GB of total system RAM is reliable for Conda install, whereas 8GB may have issues. Three solutions are available:
* Increase available RAM (if running on a compute cluster etc)
* Use [Mamba](https://mamba.readthedocs.io/en/latest/), a more efficient drop-in replacement for Conda
* Create a blank conda environment and install the required packages:
```bash
conda create --name sharpy python=3.10
conda config –add channels conda-forge
conda install eigen libopenblas libblas libcblas liblapack libgfortran libgcc libgfortran-ng
```

6. Activate the `sharpy` conda environment:
```bash
conda activate sharpy
```
Expand Down Expand Up @@ -293,6 +303,20 @@ python -m unittest

**Enjoy!**

## Obtain SHARPy from PyPI (experimental!)

You can obtain a built version of SHARPy, ic-sharpy, from PyPI [here](https://pypi.org/project/ic-sharpy/).

To install at default directory use
```
python3 -m pip install ic-sharpy
```
To install at current directory use
```
python3 -m pip install --prefix . ic-sharpy
```
The source code can be found at `/lib/python3.10/site-packages/sharpy` and the executable at `/bin/sharpy`.

## Running SHARPy

### Automated tests
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def run(self):
long_description = f.read()
run()
setup(
name="sharpy",
name="ic_sharpy", # due to the name sharpy being taken on pypi
version=__version__,
description="""SHARPy is a nonlinear aeroelastic analysis package developed
at the Department of Aeronautics, Imperial College London. It can be used
Expand Down Expand Up @@ -139,7 +139,7 @@ def run(self):
"colorama",
"dill",
"jupyterlab",
"mayavi @ git+https://github.com/enthought/mayavi.git", #Used for TVTK. Bug in pip install, hence git clone
"mayavi", # github direct dependency removed since pip version is fixed, and also not compatible with pypi
"pandas",
"control",
"openpyxl>=3.0.10",
Expand All @@ -162,8 +162,11 @@ def run(self):
],
},
classifiers=[
"Operating System :: Linux, Mac OS",
"Programming Language :: Python, C++",
"Operating System :: MacOS",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3.10",
"Programming Language :: Fortran",
"Programming Language :: C++"
],

entry_points={
Expand Down
Loading
Loading