Skip to content

Commit

Permalink
added packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
japaf committed Sep 22, 2019
1 parent af8d690 commit 6f45679
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 8 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include *.txt
recursive-include src *.cc *.hh
4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,4 @@ Hosted online on `Read the Docs <https://foamgen.rtfd.io>`_.
License
-------

`MIT`_ © 2019 Pavel Ferkl

.. _MIT: LICENSE
`MIT <https://github.com/japaf/foamgen/blob/master/LICENSE>`_ © 2019 Pavel Ferkl
1 change: 1 addition & 0 deletions docs/source/developer/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ Additional information for developers.
documentation
tests
contribute
package
23 changes: 23 additions & 0 deletions docs/source/developer/package.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Packaging
=========

Install ``twine``::

pip install twine

Create source distribution (don't create platform wheel, because PyPI accepts
only `manylinux1 wheels <https://www.scivision.dev/easy-upload-to-pypi/>`_::

python setup.py sdist

Test upload to `TestPyPI <https://test.pypi.org>`_::

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Test installation::

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple foamgen

Upload to `PyPI <https://pypi.org/>`_::

twine upload dist/*
6 changes: 3 additions & 3 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ and install available compiled dependencies::
conda install -c conda-forge cmake gsl fenics
conda install -c tpaviot -c conda-forge -c dlr-sc -c oce -c pythonocc pythonocc-core=0.18.2 wxPython

Other dependencies are not packaged very well. However, on Ubuntu 18.04, they
can be installed using `install_dependencies.sh
Other dependencies cannot be installed that easily. However, on Ubuntu 18.04,
they can be installed using `install_dependencies.sh
<https://github.com/japaf/foamgen/blob/master/install_dependencies.sh>`_
script::

Expand All @@ -47,7 +47,7 @@ Package

Install using ``pip`` as::

pip install .
pip install foamgen

It compiles the package and installs the ``foamgen`` package and executable. If
this fails on cmake compilation, you can check the :ref:`Developer
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@

def long_desc():
"""Create long description."""
with open("README.rst", "r") as fhl:
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.rst'), encoding='utf-8') as fhl:
long_description = fhl.read()
return long_description

Expand Down Expand Up @@ -120,7 +121,7 @@ def copy_test_file(self, src_file):
keywords='foam generation reconstruction morphology',
description="Generate virtual closed-cell or open-cell foam structure.",
long_description=long_desc(),
long_description_content_type="text/markdown",
long_description_content_type="text/x-rst",
url="https://github.com/japaf/foamgen",
packages=find_packages('src'),
package_dir={'': 'src'},
Expand Down

0 comments on commit 6f45679

Please sign in to comment.