Skip to content

Commit

Permalink
pypi publishing (#28)
Browse files Browse the repository at this point in the history
* adapt setup.py for versioning using setuptools_scm
* add CI for Pypi publishing
  • Loading branch information
alexsavulescu authored May 16, 2022
1 parent fc73f08 commit ab447e5
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 26 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
13 changes: 0 additions & 13 deletions requirements.txt

This file was deleted.

41 changes: 28 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pathlib
from setuptools import setup, find_packages
import pkg_resources

install_requires = [
# core
'requests',
'pyyaml',
'docopt',
'jinja2',
'pyvirtualdisplay',

def get_install_requires():
install_requires = []
with pathlib.Path('requirements.txt').open() as requirements_txt:
install_requires = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
return install_requires
# for running models
'pyqt5',
'ipython',
'matplotlib',
'scipy',
'2to3',
]

with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()


def setup_package():

setup(
name='nrn-modeldb-ci',
version='0.0.1',
description='NEURON ModelDB CI tools',
url='https://github.com/neuronsimulator/nrn-modeldb-ci',
author='EPFL Blue Brain Project & Yale',
author_email='[email protected]',
license='BSD-3-Clause',
packages=find_packages(),
install_requires=get_install_requires(),
use_scm_version=True,
include_package_data=True,
install_requires=install_requires,
setup_requires=['setuptools_scm'],
entry_points=dict(
console_scripts=[
'runmodels = modeldb.commands:runmodels',
Expand All @@ -34,6 +47,8 @@ def setup_package():
'diffreports2html = modeldb.commands:diffreports2html',
]
),
long_description=long_description,
long_description_content_type="text/markdown",
)


Expand Down

0 comments on commit ab447e5

Please sign in to comment.