Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit f61cfdd

Browse files
Setup GitHub CI
1 parent 7519c28 commit f61cfdd

File tree

7 files changed

+181
-84
lines changed

7 files changed

+181
-84
lines changed

.github/workflows/publish-sdist.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- main
9+
release:
10+
types:
11+
- published
12+
13+
jobs:
14+
build:
15+
name: Build distribution
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Build a binary wheel and a source tarball
21+
run: pipx run build
22+
- name: Check metadata
23+
run: pipx run twine check dist/*
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: python-package-distributions
28+
path: dist/
29+
30+
publish-to-pypi:
31+
name: Publish Python distribution to PyPI
32+
if: github.event_name == 'release' && github.event.action == 'published'
33+
needs:
34+
- build
35+
runs-on: ubuntu-latest
36+
environment:
37+
name: pypi
38+
url: https://pypi.org/p/connectome-tools
39+
permissions:
40+
id-token: write # IMPORTANT: mandatory for trusted publishing
41+
42+
steps:
43+
- name: Download all the dists
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: python-package-distributions
47+
path: dist/
48+
- name: Publish distribution to PyPI
49+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run-tox.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Run tox
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
include:
15+
- python-version: '3.8'
16+
tox-env: py38
17+
- python-version: '3.9'
18+
tox-env: py39
19+
- python-version: '3.10'
20+
tox-env: py310
21+
- python-version: '3.11'
22+
tox-env: py311
23+
- python-version: '3.12'
24+
tox-env: py312
25+
codecov: codecov
26+
- python-version: '3.12'
27+
tox-env: lint
28+
- python-version: '3.12'
29+
tox-env: docs
30+
- python-version: '3.12'
31+
tox-env: check-packaging
32+
steps:
33+
- name: Checkout code
34+
uses: actions/checkout@v4
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip setuptools wheel
42+
python -m pip install --upgrade tox tox-uv
43+
- name: Run tox
44+
run: |
45+
tox run -e ${{ matrix.tox-env }}
46+
- name: Upload to codecov
47+
if: ${{ matrix.codecov == 'codecov' }}
48+
uses: codecov/codecov-action@v4
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
fail_ci_if_error: false
52+
files: ./coverage.xml
53+
flags: pytest
54+
verbose: true
55+
name: "${{ github.repository }}-${{ matrix.tox-env }}"

.gitlab-ci.yml

-3
This file was deleted.

connectome_tools/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Connectome tools."""
22

3-
from connectome_tools.version import __version__
3+
from connectome_tools._version import __version__ # noqa

connectome_tools/version.py

-4
This file was deleted.

pyproject.toml

+74
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,82 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "setuptools_scm>=8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "connectome-tools"
7+
description = "Connectome statistics; S2F recipe generation"
8+
readme = "README.rst"
9+
requires-python = ">=3.8"
10+
authors = [
11+
{name = "Blue Brain Project, EPFL", email = "bbp-ou-nse@groupes.epfl.ch"},
12+
]
13+
dependencies = [
14+
"click>=7.0,<9.0",
15+
"importlib-metadata",
16+
"importlib-resources",
17+
"joblib>=1.0.1",
18+
"jsonschema>=3.2.0,<5.0.0",
19+
"lxml>=3.3",
20+
"numpy>=1.9",
21+
"pandas>=1.0.0",
22+
"psutil>=5.7.2",
23+
"pyyaml>=5.3.1",
24+
"submitit>=1.4,<2.0",
25+
"bluepysnap<2.0",
26+
"morphio>=3.0.1,<4.0.0",
27+
"voxcell>=3.0,<4.0",
28+
# setuptools needed because of https://github.com/facebookincubator/submitit/issues/1765
29+
'setuptools;python_version>="3.12"',
30+
]
31+
license = {text = "Apache-2.0"}
32+
classifiers=[
33+
"Development Status :: 2 - Pre-Alpha",
34+
"Intended Audience :: Education",
35+
"Intended Audience :: Science/Research",
36+
"Programming Language :: Python",
37+
"Programming Language :: Python :: 3",
38+
"Programming Language :: Python :: 3.8",
39+
"Programming Language :: Python :: 3.9",
40+
"Programming Language :: Python :: 3.10",
41+
"Programming Language :: Python :: 3.11",
42+
"Programming Language :: Python :: 3.12",
43+
"Programming Language :: Python :: 3.13",
44+
"Topic :: Scientific/Engineering :: Bio-Informatics",
45+
]
46+
dynamic = ["version"]
47+
48+
[project.optional-dependencies]
49+
docs = [
50+
"sphinx",
51+
"sphinx-bluebrain-theme",
52+
]
53+
54+
[project.urls]
55+
Homepage = "https://github.com/BlueBrain/connectome-tools"
56+
Repository = "https://github.com/BlueBrain/connectome-tools.git"
57+
Documentation = "https://connectome-tools.readthedocs.io"
58+
Tracker = "https://github.com/BlueBrain/connectome-tools/issues"
59+
60+
[project.scripts]
61+
connectome-stats = "connectome_tools.apps.connectome_stats:app"
62+
s2f-recipe = "connectome_tools.apps.s2f_recipe:app"
63+
s2f-recipe-merge = "connectome_tools.apps.s2f_recipe_merge:cli"
64+
65+
[tool.setuptools.packages.find]
66+
include = ["connectome_tools"]
67+
68+
[tool.setuptools_scm]
69+
version_file = "connectome_tools/_version.py"
70+
171
[tool.black]
272
line-length = 100
373
target-version = [
474
'py38',
575
'py39',
76+
'py310',
77+
'py311',
78+
'py312',
79+
'py313',
680
]
781
include = 'connectome_tools\/.*\.py$|tests\/.*\.py$|doc\/source\/conf\.py$|setup\.py$'
882

setup.py

+2-76
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,3 @@
1-
#!/usr/bin/env python
2-
# pylint: disable=missing-docstring
3-
import importlib.util
1+
from setuptools import setup
42

5-
from setuptools import find_packages, setup
6-
7-
# read the contents of the README file
8-
with open("README.rst", encoding="utf-8") as f:
9-
README = f.read()
10-
11-
spec = importlib.util.spec_from_file_location(
12-
"connectome_tools.version",
13-
"connectome_tools/version.py",
14-
)
15-
module = importlib.util.module_from_spec(spec)
16-
spec.loader.exec_module(module)
17-
VERSION = module.__version__
18-
19-
setup(
20-
name="connectome-tools",
21-
author="BlueBrain NSE",
22-
author_email="bbp-ou-nse@groupes.epfl.ch",
23-
version=VERSION,
24-
description="Connectome statistics; S2F recipe generation",
25-
long_description=README,
26-
long_description_content_type="text/x-rst",
27-
url="https://bbpteam.epfl.ch/documentation/projects/connectome-tools",
28-
project_urls={
29-
"Tracker": "https://bbpteam.epfl.ch/project/issues/projects/NSETM/issues",
30-
"Source": "https://bbpgitlab.epfl.ch/nse/connectome-tools/",
31-
},
32-
license="BBP-internal-confidential",
33-
install_requires=[
34-
"click>=7.0,<9.0",
35-
"importlib-metadata",
36-
"importlib-resources",
37-
"joblib>=1.0.1",
38-
"jsonschema>=3.2.0,<5.0.0",
39-
"lxml>=3.3",
40-
"numpy>=1.9",
41-
"pandas>=1.0.0",
42-
"psutil>=5.7.2",
43-
"pyyaml>=5.3.1",
44-
"submitit>=1.4,<2.0",
45-
"bluepysnap<2.0",
46-
"morphio>=3.0.1,<4.0.0",
47-
"voxcell>=3.0,<4.0",
48-
# setuptools needed because of https://github.com/facebookincubator/submitit/issues/1765
49-
'setuptools;python_version>="3.12"',
50-
51-
#"bluepy>=2.3,<3.0",
52-
],
53-
packages=find_packages(),
54-
include_package_data=True,
55-
python_requires=">=3.8",
56-
extras_require={"docs": ["sphinx", "sphinx-bluebrain-theme"]},
57-
classifiers=[
58-
"Development Status :: 2 - Pre-Alpha",
59-
"Intended Audience :: Education",
60-
"Intended Audience :: Science/Research",
61-
"Programming Language :: Python",
62-
"Programming Language :: Python :: 3",
63-
"Programming Language :: Python :: 3.8",
64-
"Programming Language :: Python :: 3.9",
65-
"Programming Language :: Python :: 3.10",
66-
"Programming Language :: Python :: 3.11",
67-
"Programming Language :: Python :: 3.12",
68-
"Topic :: Scientific/Engineering :: Bio-Informatics",
69-
],
70-
entry_points={
71-
"console_scripts": [
72-
"connectome-stats=connectome_tools.apps.connectome_stats:app",
73-
"s2f-recipe=connectome_tools.apps.s2f_recipe:app",
74-
"s2f-recipe-merge=connectome_tools.apps.s2f_recipe_merge:cli",
75-
],
76-
},
77-
)
3+
setup()

0 commit comments

Comments
 (0)