Skip to content

Commit a081c0f

Browse files
authored
Pypi (#525)
* Create python-publish.yml * Update python-publish.yml * basic pyproject.toml * Update python-publish.yml * try to trigger action * fix dependencies * Update python-publish.yml * use * for Python micro version * Bump version for reupload to TestPyPI * remove pytest dependency * Update pyproject.toml * move to PyPI * Update pyproject.toml * try console script via pyproject.toml * Update python-publish.yml * cleanup * use miniforge for CI test * Update action versions * Add installation option for PyPI
1 parent e7da354 commit a081c0f

File tree

5 files changed

+79
-15
lines changed

5 files changed

+79
-15
lines changed

.github/workflows/ci-test.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ jobs:
66
build-linux:
77
runs-on: "ubuntu-latest"
88
steps:
9-
- uses: actions/checkout@v2
10-
- uses: conda-incubator/setup-miniconda@v2
9+
- uses: actions/checkout@v4
10+
- uses: conda-incubator/setup-miniconda@v3
1111
with:
1212
auto-update-conda: true
1313
python-version: ${{ matrix.python-version }}
1414
environment-file: environment.yml
15+
miniforge-version: latest
1516
activate-environment: cnapy
1617
- name: Test CNApy
1718
run: |
@@ -24,12 +25,13 @@ jobs:
2425
build-windows:
2526
runs-on: "windows-latest"
2627
steps:
27-
- uses: actions/checkout@v2
28-
- uses: conda-incubator/setup-miniconda@v2
28+
- uses: actions/checkout@v4
29+
- uses: conda-incubator/setup-miniconda@v3
2930
with:
3031
auto-update-conda: true
3132
python-version: ${{ matrix.python-version }}
3233
environment-file: environment.yml
34+
miniforge-version: latest
3335
activate-environment: cnapy
3436
- name: Test CNApy
3537
run: |

.github/workflows/python-publish.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
workflow_dispatch:
15+
branches:
16+
- "pypi"
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
deploy:
22+
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Set up Python
28+
uses: actions/setup-python@v3
29+
with:
30+
python-version: '3.x'
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install build
35+
- name: Build package
36+
run: python -m build
37+
- name: Publish package
38+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
39+
with:
40+
user: axelk1
41+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ Aside of performing calculations on metabolic models, CNApy can also be used to
4949
There are 4 alternative ways to install CNApy:
5050

5151
1. If you use Windows, the easiest way is to use our Windows installer, see section [Using the Windows installer](#using-the-windows-installer).
52-
2. If you already have installed [Anaconda](https://www.anaconda.com/), [Miniconda](https://docs.anaconda.com/free/miniconda/index.html) or [Miniforge](https://github.com/conda-forge/miniforge) on your computer, you can directly install CNApy as a conda package as described in section [Install CNApy as conda package](#install-cnapy-as-conda-package). *Note*: If you're on MacOS and want to use CPLEX as solver, you have to use the x86 version of Anaconda as the Apple Silicon one is not supported by CPLEX yet.
53-
3. If you use Linux or Apple MacOS X, the easiest installation producure is our assisted installation protocol, see [Assisted installation under Linux and MacOS X](#assisted-installation-under-linux-and-macos-x).
54-
4. If you want to develop CNApy, follow the instruction for the cloning and setup of the CNApy repository using git and conda or mamba in section [Setup the CNApy development environment](#setup-the-cnapy-development-environment).
52+
2. If you have Python 3.10 on your computer you can directly install CNApy from PyPI with: ```pip install cnapy```.
53+
3. If you have installed [Anaconda](https://www.anaconda.com/), [Miniconda](https://docs.anaconda.com/free/miniconda/index.html) or [Miniforge](https://github.com/conda-forge/miniforge) on your computer, you can directly install CNApy as a conda package as described in section [Install CNApy as conda package](#install-cnapy-as-conda-package). *Note*: If you're on MacOS and want to use CPLEX as solver, you have to use the x86 version of Anaconda as the Apple Silicon one is not supported by CPLEX yet.
54+
4. If you use Linux or Apple MacOS X, the easiest installation producure is our assisted installation protocol, see [Assisted installation under Linux and MacOS X](#assisted-installation-under-linux-and-macos-x).
55+
5. If you want to develop CNApy, follow the instruction for the cloning and setup of the CNApy repository using git and conda or mamba in section [Setup the CNApy development environment](#setup-the-cnapy-development-environment).
5556

5657
## Contribute to the CNApy development
5758

pyproject.toml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "cnapy"
3+
version = "1.2.1.1"
4+
authors = [
5+
{ name="Sven Thiele" },
6+
{ name="Axel von Kamp" },
7+
{ name="Pavlos Stephanos Bekiaris" },
8+
{ name="Philipp Schneider" }
9+
]
10+
description = "An integrated environment for metabolic network analysis."
11+
readme = "README.md"
12+
requires-python = "==3.10.*"
13+
classifiers = [
14+
"Programming Language :: Python :: 3",
15+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
16+
"Operating System :: OS Independent",
17+
]
18+
dependencies = ["appdirs>=1.4", "matplotlib>=3.6", "requests>=2.28",
19+
"cobra>=0.29", "efmtool_link>=0.0.7", "optlang_enumerator>=0.0.12", "straindesign>=1.12",
20+
"qtpy>=2.3", "pyqtwebengine>=5.15", "qtconsole==5.4",
21+
"gurobipy>=11.0", "cplex>=22.1", "numpy==1.23", "scipy==1.12", "openpyxl"]
22+
23+
[project.scripts]
24+
cnapy = "cnapy.__main__:main_cnapy"
25+
[project.urls]
26+
Homepage = "https://github.com/cnapy-org/CNApy"
27+
Issues = "https://github.com/cnapy-org/CNApy/issues"

setup.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,11 @@
1818

1919
setup(
2020
name='cnapy',
21-
version='1.2.1',
22-
url='https://github.com/cnapy-org/CNApy/',
23-
license='GPLv3+',
2421
description='An integrated environment for metabolic network analysis.',
2522
long_description=open('README.md', encoding="utf8").read(),
2623
long_description_content_type="text/asciidoc",
27-
author='Sven Thiele',
28-
author_email='sthiele78@gmail.com',
2924
packages=['cnapy', 'cnapy.gui_elements'],
3025
package_dir={'cnapy': 'cnapy'},
3126
package_data={'cnapy': [
32-
'data/*.svg', 'data/escher_cnapy.html', 'data/escher.min.js']},
33-
entry_points={'console_scripts': [
34-
'cnapy = cnapy.__main__:main_cnapy']},
27+
'data/*.svg', 'data/escher_cnapy.html', 'data/escher.min.js']}
3528
)

0 commit comments

Comments
 (0)