Skip to content

Commit 6acefdc

Browse files
Chore: Compatibility with SQLAlchemy>=2
1 parent 050d199 commit 6acefdc

14 files changed

+120
-62
lines changed

.auto-changelog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"tagPrefix": "bluepyparallel-v",
55
"commitLimit": false,
66
"backfillLimit": false,
7-
"ignoreCommitPattern": "Release [0-9]+\\.[0-9]+\\.[0-9]+|Update CHANGELOG.*|.*\\[skip-changelog\\].*|\\[pre-commit.ci\\]",
7+
"ignoreCommitPattern": "Release:? [0-9]+\\.[0-9]+\\.[0-9]+|Update CHANGELOG.*|.*\\[skip-changelog\\].*|\\[pre-commit.ci\\]",
88
"commitUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/commit/{id}",
99
"issueUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/issues/{id}",
1010
"mergeUrl": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel/merge_requests/{id}",

.auto-changelog-template.hbs

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Introduction
99
• The types feat:, fix:, chore:, docs:, refactor:, test:, style:, perf: must be at the beginning of the commit subject with an : on end.
1010
• They can optionally have a scope set to outline the module or component that is affected eg feat(bldAssess):
1111
• There is a short hash on the end of every commit that is currently commented out so that change log did not grow too long (due to some system's file size limitations). You can uncomment if you wish [`{{shorthash}}`]({{href}})
12+
1213
Example Definitions
1314
• feat: A new feature
1415
• fix: A bug fix
@@ -30,6 +31,8 @@ Example Definitions
3031
"replaceText": {
3132
"([bB]reaking:)": "",
3233
"([bB]reaking change:)": "",
34+
"(^[bB]uild:)": "",
35+
"(^[bB]uild\\()": "\\(",
3336
"(^[fF]eat:)": "",
3437
"(^[fF]eat\\()": "\\(",
3538
"(^[fF]ix:)": "",
@@ -59,7 +62,7 @@ Example Definitions
5962
\s = whitespace
6063
. = any character except newline
6164
| = or
62-
[aA] = charcter a or character A
65+
[aA] = character a or character A
6366
--}}
6467

6568

@@ -87,7 +90,11 @@ Example Definitions
8790
{{/commit-list}}
8891

8992
{{! List commits organised under a heading, but not those already listed in the breaking section }}
90-
{{#commit-list merges heading='### New Features' message='^[fF]eat:|[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
93+
{{#commit-list merges heading='### Build' message='^[bB]uild:|^[bB]uild\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
94+
- {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}})
95+
{{/commit-list}}
96+
97+
{{#commit-list merges heading='### New Features' message='^[fF]eat:|^[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
9198
- {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}})
9299
{{/commit-list}}
93100

@@ -123,7 +130,7 @@ Example Definitions
123130
- {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}})
124131
{{/commit-list}}
125132

126-
{{#commit-list merges heading='### Uncategorized Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}}
133+
{{#commit-list merges heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}}
127134
- {{message}} ({{author}}{{#if href}} - [#{{id}}]({{href}}){{/if}})
128135
{{/commit-list}}
129136

@@ -133,7 +140,11 @@ Example Definitions
133140
{{/commit-list}}
134141

135142
{{! List commits organised under a heading, but not those already listed in the breaking section }}
136-
{{#commit-list commits heading='### New Features' message='^[fF]eat:|[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
143+
{{#commit-list commits heading='### Build' message='^[bB]uild:|^[bB]uild\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
144+
- {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}})
145+
{{/commit-list}}
146+
147+
{{#commit-list commits heading='### New Features' message='^[fF]eat:|^[fF]eat\(' exclude='[bB]reaking [cC]hange:|[bB]reaking:|\[skip-changelog\]'}}
137148
- {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}})
138149
{{/commit-list}}
139150

@@ -169,7 +180,7 @@ Example Definitions
169180
- {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}})
170181
{{/commit-list}}
171182

172-
{{#commit-list commits heading='### Uncategorized Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}}
183+
{{#commit-list commits heading='### General Changes' exclude='[bB]reaking [cC]hange:|[bB]reaking:|^[bB]uild:|^[bB]uild\(|^[fF]eat:|^[fF]eat\(|^[fF]ix:|^[fF]ix\(|^[cC]hore:|^[cC]hore\(|^[cC][iI]:|^[cC][iI]\(|^[dD]ocs:|^[dD]ocs\(|^[rR]efactor:|^[rR]efactor\(|^[tT]est:|^[tT]est\(|^[sS]tyle:|^[sS]tyle\(|^[pP]erf:|^[pP]erf\(|\[skip-changelog\]'}}
173184
- {{subject}} ({{author}}{{#if href}} - [{{shorthash}}]({{href}}){{/if}})
174185
{{/commit-list}}
175186

.copier-answers.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changes here will be overwritten by Copier
22

3-
_commit: 0.1.12
3+
_commit: 0.1.34
44
_src_path: [email protected]:neuromath/python-template.git
55
author_email: [email protected]
66
author_name: bbp-ou-cells
@@ -9,7 +9,7 @@ copyright_year: '2022'
99
distribution_name: bluepyparallel
1010
download_url: https://bbpgitlab.epfl.ch/neuromath/bluepyparallel
1111
init_git: false
12-
maintainer: null
12+
maintainer: Adrien Berchet
1313
package_name: bluepyparallel
1414
project_description: Provides an embarassingly parallel tool with sql backend.
1515
project_name: BluePyParallel
@@ -21,6 +21,6 @@ ssh_url: [email protected]:neuromath/bluepyparallel.git
2121
support_py37: true
2222
team_name: neuromath
2323
tracker_url: https://bbpteam.epfl.ch/project/issues/projects/CELLS/issues
24-
version: 0.0.8.dev0
24+
version: 0.0.9.dev0
2525

2626
# End of Copier answers

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.asc linguist-detectable=false
2+
.auto-changelog-template.hbs linguist-detectable=false
3+
commitlint.config.js linguist-detectable=false

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*py~
77
*~
88
*.egg-info
9+
*.zip
910

1011
# Mac related stuff
1112
.DS_Store
@@ -41,3 +42,6 @@ examples/.ipynb_checkpoints
4142
# Node
4243
node_modules
4344
package-lock.json
45+
46+
# dask
47+
**/dask-worker-space/

bluepyparallel/database.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def db_exists(self):
105105
return False
106106

107107
def exists(self, table_name, schema_name=None):
108-
"""Test that the table exists in the database."""
108+
"""Check that the table exists in the database."""
109109
inspector = Inspector.from_engine(self.engine)
110110
return table_name in inspector.get_table_names(schema=schema_name)
111111

@@ -116,13 +116,12 @@ def reflect(self, table_name, schema_name=None):
116116
table_name,
117117
self.metadata,
118118
schema=schema_name,
119-
autoload=True,
120119
autoload_with=self.engine,
121120
)
122121

123122
def load(self):
124123
"""Load the table data from the database."""
125-
query = select([self.table])
124+
query = select(self.table)
126125
return pd.read_sql(query, self.connection, index_col=self.index_col)
127126

128127
def write(self, row_id, result=None, exception=None, **input_values):
@@ -136,6 +135,7 @@ def write(self, row_id, result=None, exception=None, **input_values):
136135

137136
query = insert(self.table).values(dict(**{self.index_col: row_id}, **vals, **input_values))
138137
self.connection.execute(query)
138+
self.connection.connection.commit()
139139

140140
def write_batch(self, columns, data):
141141
"""Write entries from a list of lists into the table."""

commitlint.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = {
2525
'Fix',
2626
'Perf',
2727
'Refactor',
28+
'Release',
2829
'Revert',
2930
'Style',
3031
'Test',
@@ -95,6 +96,11 @@ module.exports = {
9596
title: 'Reverts',
9697
emoji: '🗑',
9798
},
99+
Release: {
100+
description: 'Release commit',
101+
title: 'Release',
102+
emoji: '🎉',
103+
},
98104
},
99105
},
100106
scope: {

examples/large_computation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Example of large computation using BluePyParallel."""
12
import sys
23
import time
34

@@ -9,7 +10,7 @@
910

1011

1112
def func(row):
12-
"""Trivial computation"""
13+
"""Trivial computation."""
1314
time.sleep(1)
1415

1516
if row["data"] in [1, 3]:

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ target-version = [
1414
"py38",
1515
"py39",
1616
]
17-
include = 'bluepyparallel\/.*\.py$|tests\/.*\.py$|docs\/source\/conf\.py$|setup\.py$'
1817

1918
# PYDOCSTYLE
2019
[tool.pydocstyle]
@@ -24,7 +23,6 @@ add-ignore = [
2423
"D107",
2524
]
2625
convention = "google"
27-
match = "[bluepyparallel, tests, docs/source/conf.py, setup.py]"
2826

2927
# ISORT
3028
[tool.isort]

setup.py

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import importlib.util
33
from pathlib import Path
44

5-
from setuptools import find_packages
5+
from setuptools import find_namespace_packages
66
from setuptools import setup
77

88
spec = importlib.util.spec_from_file_location(
@@ -14,13 +14,15 @@
1414
VERSION = module.VERSION
1515

1616
reqs = [
17-
"pandas",
18-
"ipyparallel<7",
19-
"dask[dataframe, distributed]>=2.30",
20-
"dask-mpi>=2.20",
21-
"sqlalchemy>1.4",
22-
"sqlalchemy-utils",
23-
"tqdm",
17+
"pandas>=1.3",
18+
"ipyparallel>=6.3,<7",
19+
"dask[dataframe, distributed]>=2021.11",
20+
"dask-mpi>=2021.11",
21+
"distributed>=2021.11",
22+
"sqlalchemy>=1.4.24",
23+
"sqlalchemy<2; python_version<'3.8'",
24+
"sqlalchemy-utils>=0.37.2",
25+
"tqdm>=3.7",
2426
]
2527

2628
doc_reqs = [
@@ -30,11 +32,11 @@
3032
]
3133

3234
test_reqs = [
33-
"mpi4py",
34-
"pytest",
35-
"pytest-benchmark",
36-
"pytest-cov",
37-
"pytest-html",
35+
"mpi4py>=3.0.1",
36+
"pytest>=6.1",
37+
"pytest-benchmark>=3.4",
38+
"pytest-cov>=3",
39+
"pytest-html>=3.1",
3840
]
3941

4042
setup(
@@ -50,14 +52,15 @@
5052
"Source": "https://bbpgitlab.epfl.ch/neuromath/bluepyparallel",
5153
},
5254
license="BBP-internal-confidential",
53-
packages=find_packages(include=["bluepyparallel"]),
55+
packages=find_namespace_packages(include=["bluepyparallel*"]),
5456
python_requires=">=3.7",
5557
version=VERSION,
5658
install_requires=reqs,
5759
extras_require={
5860
"docs": doc_reqs,
5961
"test": test_reqs,
6062
},
63+
include_package_data=True,
6164
classifiers=[
6265
"Development Status :: 4 - Beta",
6366
"Intended Audience :: Developers",
@@ -66,6 +69,8 @@
6669
"Programming Language :: Python :: 3.7",
6770
"Programming Language :: Python :: 3.8",
6871
"Programming Language :: Python :: 3.9",
72+
"Programming Language :: Python :: 3.10",
73+
"Programming Language :: Python :: 3.11",
74+
"Topic :: Scientific/Engineering :: Bio-Informatics",
6975
],
70-
include_package_data=True,
7176
)

0 commit comments

Comments
 (0)