Skip to content

Commit ab447e5

Browse files
pypi publishing (#28)
* adapt setup.py for versioning using setuptools_scm * add CI for Pypi publishing
1 parent fc73f08 commit ab447e5

File tree

3 files changed

+59
-26
lines changed

3 files changed

+59
-26
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
deploy:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up Python
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: '3.x'
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install build
25+
- name: Build package
26+
run: python -m build
27+
- name: Publish package
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
user: __token__
31+
password: ${{ secrets.PYPI_API_TOKEN }}

requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

setup.py

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,42 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import pathlib
54
from setuptools import setup, find_packages
6-
import pkg_resources
75

6+
install_requires = [
7+
# core
8+
'requests',
9+
'pyyaml',
10+
'docopt',
11+
'jinja2',
12+
'pyvirtualdisplay',
813

9-
def get_install_requires():
10-
install_requires = []
11-
with pathlib.Path('requirements.txt').open() as requirements_txt:
12-
install_requires = [
13-
str(requirement)
14-
for requirement
15-
in pkg_resources.parse_requirements(requirements_txt)
16-
]
17-
return install_requires
14+
# for running models
15+
'pyqt5',
16+
'ipython',
17+
'matplotlib',
18+
'scipy',
19+
'2to3',
20+
]
21+
22+
with open('README.md', 'r', encoding='utf-8') as f:
23+
long_description = f.read()
1824

1925

2026
def setup_package():
2127

2228
setup(
2329
name='nrn-modeldb-ci',
24-
version='0.0.1',
30+
description='NEURON ModelDB CI tools',
31+
url='https://github.com/neuronsimulator/nrn-modeldb-ci',
32+
author='EPFL Blue Brain Project & Yale',
33+
author_email='[email protected]',
34+
license='BSD-3-Clause',
2535
packages=find_packages(),
26-
install_requires=get_install_requires(),
36+
use_scm_version=True,
37+
include_package_data=True,
38+
install_requires=install_requires,
39+
setup_requires=['setuptools_scm'],
2740
entry_points=dict(
2841
console_scripts=[
2942
'runmodels = modeldb.commands:runmodels',
@@ -34,6 +47,8 @@ def setup_package():
3447
'diffreports2html = modeldb.commands:diffreports2html',
3548
]
3649
),
50+
long_description=long_description,
51+
long_description_content_type="text/markdown",
3752
)
3853

3954

0 commit comments

Comments
 (0)