Skip to content

Commit

Permalink
Publish to PyPI (#94)
Browse files Browse the repository at this point in the history
* Use name FEniCS-preCICE adapter in setup.py description and README.md.
* Modify documentation of installation and recommend to use PyPI.
* Add Github Actions workflow .github/workflow/pythonpublish.yml for publishing on new tags.

Co-authored-by: Benjamin Uekermann <[email protected]>
Co-authored-by: ishaandesai <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2020
1 parent af3dd65 commit 81525a1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Upload Python Package

on:
push:
tags:
- v*

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist
twine upload dist/*
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# FEniCS-preCICE adapter
FEniCS-preCICE adapter
----------------------

<a style="text-decoration: none" href="https://travis-ci.org/precice/fenics-adapter" target="_blank">
<img src="https://travis-ci.org/precice/fenics-adapter.svg?branch=master" alt="Build status">
Expand All @@ -15,11 +16,21 @@ _**Note:** This adapter is currently purely expermental and limited in functiona

This adapter was developed by [Benjamin Rüth](https://www5.in.tum.de/wiki/index.php/Benjamin_R%C3%BCth,_M.Sc._(hons)) during his research stay at Lund University in the group for [Numerical Analysis](http://www.maths.lu.se/english/research/research-divisions/numerical-analysis/) in close collaboration with [Peter Meisrimel](https://www.lunduniversity.lu.se/lucat/user/09d80f0367a060bcf2a22d7c22e5e504).

## Installation
# Installing the package

### Dependencies
## Using pip3 to install from PyPI

Make sure to install
It is recommended to install [fenicsprecice from PyPI](https://pypi.org/project/fenicsprecice/) via
```
$ pip3 install --user fenicsprecice
```
This should work out of the box, if all dependencies are installed correctly. If you face problems during installation or you want to run the tests, see below for a list of dependencies and alternative installation procedures

## Clone this repository and use pip3

### Required dependencies

Make sure to install the following dependencies:

* [preCICE](https://github.com/precice/precice/wiki)
* python3 (this adapter **only supports python3**)
Expand All @@ -29,8 +40,7 @@ Make sure to install

### Build and install the adapter

Download or clone the adapter repository to the system.
Run `pip3 install --user .` from your shell.
After cloning this repository and switching to the root directory (`fenics-adapter`), run ``pip3 install --user .`` from your shell.

### Test the adapter

Expand All @@ -43,24 +53,24 @@ Single tests can be also be run. For example the test `test_vector_write` in the
python3 -m unittest tests.test_write_read.TestWriteandReadData.test_vector_write
```

## Use the adapter
# Use the adapter

Add ``from fenicsprecice import Adapter`` in your FEniCS code. Please refer to the examples in the [tutorials repository](https://github.com/precice/tutorials) for usage examples:

The adapter is configured via a `json` configuration file. For example configuration files and usage refer to the tutorials ([fenics-fenics](https://github.com/precice/tutorials/tree/master/HT/partitioned-heat/fenics-fenics)).

## Packaging
# Packaging

To create and install the `fenicsprecice` python package the following instructions were used: https://python-packaging.readthedocs.io/en/latest/index.html.

## Citing
# Citing

preCICE is an academic project, developed at the [Technical University of Munich](https://www5.in.tum.de/) and at the [University of Stuttgart](https://www.ipvs.uni-stuttgart.de/). If you use preCICE, please [cite us](https://www.precice.org/publications/):

*H.-J. Bungartz, F. Lindner, B. Gatzhammer, M. Mehl, K. Scheufele, A. Shukaev, and B. Uekermann: preCICE - A Fully Parallel Library for Multi-Physics Surface Coupling. Computers and Fluids, 141, 250–258, 2016.*

If you are using FEniCS, please also consider the information on https://fenicsproject.org/citing/.

## Disclaimer
# Disclaimer

This offering is not approved or endorsed by the FEniCS Project, producer and distributor of the FEniCS software via https://fenicsproject.org/.
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from setuptools import setup

# from https://stackoverflow.com/a/9079062
Expand All @@ -9,10 +10,16 @@
version = {}
with open("fenicsprecice/version.py") as fp:
exec(fp.read(), version)

this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

setup(name='fenicsprecice',
version=version['__version__'],
description='FEniCS-preCICE adapter is a preCICE adapter for the open source computing platform FEniCS.',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/precice/fenics-adapter',
author="Benjamin Rueth",
author_email='[email protected]',
Expand Down

0 comments on commit 81525a1

Please sign in to comment.