Skip to content

Commit 5cdbce4

Browse files
authored
Merge pull request #357 from mpsonntag/re1.4.5
Preparation for version 1.4.5 release LGTM
2 parents 1232c6c + b251e4c commit 5cdbce4

File tree

5 files changed

+91
-73
lines changed

5 files changed

+91
-73
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33
Used to document all changes from previous releases and collect changes
44
until the next release.
55

6+
# Version 1.4.5
7+
8+
## Minor changes, updates and fixes.
9+
- all usages of the unsafe `yaml.load` calls are replaced with `yaml.save_load`. This also prepares for Python 3.9 compatibility. See also issue #350 and pull request #356 for details.
10+
- dtype tests now use both `assertRegexpMatches` and `assertRegex` depending on the Python version used to prepare for Python 3.9 compatibility while still keeping the Python 2 tests running.
11+
- odml style tuple handling is refactored. Now lists of odml style tuples are properly saved to file and can be loaded again. If an invalid format is used to add an odml style tuple, more detailed exception messages are available. Also adds more odml style tuples tests. See issues #250, #353 and #354 for details.
12+
- a deprecation warning is displayed when importing the odml module if a Python version <3.6 is used.
13+
- introduces minor PEP8 fixes to all files and completes docstrings for full documentation.
14+
615
# Version 1.4.4
716

817
## Introduction of inline style sheet

README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,17 @@ release notes](https://github.com/G-Node/python-odml/releases).
6969

7070
# Dependencies
7171

72-
* Python 2.7 or 3.5
72+
* Python 3.6+
7373
* Python packages:
7474

75-
* enum (version 0.4.4)
7675
* lxml (version 3.7.2)
77-
* yaml (version 3.12)
76+
* yaml (version >= 5.1)
7877
* rdflib (version >=4.2.2)
7978

8079
* These packages will be downloaded and installed automatically if the ```pip```
8180
method is used to install odML. Alternatively, they can be installed from the OS
8281
package manager. On Ubuntu, they are available as:
8382

84-
* python-enum
8583
* python-lxml
8684
* python-yaml
8785
* python-rdflib
@@ -93,6 +91,14 @@ release notes](https://github.com/G-Node/python-odml/releases).
9391
* libxslt1-dev
9492
* lib32z1-dev
9593

94+
## Previous Python versions
95+
96+
Python 2 has reached end of life. We will not keep any future versions of odml Python 2 compatible and also recommend using a Python version >= 3.6. If a Python version < 3.6 is a requirement, the following dependency needs to be installed as well:
97+
98+
* pip install
99+
* enum34 (version 0.4.4)
100+
* apt install
101+
* python-enum
96102

97103
# Building from source
98104

doc/conf.py

+63-61
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818

1919
from distutils.version import LooseVersion as CheckVer
2020

21-
currdir = os.path.dirname(os.path.abspath(__file__))
22-
parent = pathlib.Path(currdir).parent
23-
path = os.path.join(parent, "odml", "info.json")
21+
_currdir = os.path.dirname(os.path.abspath(__file__))
22+
_parent = pathlib.Path(_currdir).parent
23+
_path = os.path.join(_parent, "odml", "info.json")
2424

25-
with open(path) as infofile:
26-
infodict = json.load(infofile)
25+
with open(_path) as infofile:
26+
_infodict = json.load(infofile)
2727

28-
version_str = infodict["VERSION"]
28+
VERSION_STR = _infodict["VERSION"]
29+
COPY_RIGHT = _infodict["COPYRIGHT"]
2930

3031
# If extensions (or modules to document with autodoc) are in another directory,
3132
# add these directories to sys.path here. If the directory is relative to the
@@ -34,198 +35,199 @@
3435

3536

3637
class DocStringInheritor(type):
37-
"""A variation on
38+
"""
39+
A variation on
3840
http://groups.google.com/group/comp.lang.python/msg/26f7b4fcb4d66c95
3941
by Paul McGuire
4042
"""
4143
def __new__(meta, name, bases, clsdict):
4244
if not('__doc__' in clsdict and clsdict['__doc__']):
4345
for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()):
44-
doc=mro_cls.__doc__
46+
doc = mro_cls.__doc__
4547
if doc:
46-
clsdict['__doc__']=doc
48+
clsdict['__doc__'] = doc
4749
break
4850
for attr, attribute in clsdict.items():
4951
if not attribute.__doc__:
5052
for mro_cls in (mro_cls for base in bases for mro_cls in base.mro()
5153
if hasattr(mro_cls, attr)):
52-
doc=getattr(getattr(mro_cls,attr),'__doc__')
54+
doc = getattr(getattr(mro_cls, attr), '__doc__')
5355
if doc:
54-
attribute.__doc__=doc
56+
attribute.__doc__ = doc
5557
break
5658
return type.__new__(meta, name, bases, clsdict)
5759

60+
5861
# -- General configuration -----------------------------------------------------
5962

6063
# Add any Sphinx extension module names here, as strings. They can be extensions
6164
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
62-
extensions = ['sphinx.ext.autodoc']
65+
extensions = ["sphinx.ext.autodoc", "sphinx_rtd_theme"]
6366

6467
# Add any paths that contain templates here, relative to this directory.
65-
templates_path = ['_templates']
68+
templates_path = ["_templates"]
6669

6770
# The suffix of source filenames.
68-
source_suffix = '.rst'
71+
source_suffix = ".rst"
6972

7073
# The encoding of source files.
71-
#source_encoding = 'utf-8'
74+
# source_encoding = 'utf-8'
7275

7376
# The master toctree document.
74-
master_doc = 'index'
77+
master_doc = "index"
7578

7679
# General information about the project.
77-
project = u'python-odml'
78-
copyright = u'2011-2020, German Neuroinformatics Node (G-Node); based on work by Hagen Fritsch'
80+
project = "python-odml"
81+
copyright = COPY_RIGHT
7982

8083
# The version info for the project you're documenting, acts as replacement for
8184
# |version| and |release|, also used in various other places throughout the
8285
# built documents.
8386
#
8487
# The short X.Y version.
85-
version = "%s.%s" % (CheckVer(version_str).version[0], CheckVer(version_str).version[1])
88+
version = "%s.%s" % (CheckVer(VERSION_STR).version[0], CheckVer(VERSION_STR).version[1])
8689
# The full version, including alpha/beta/rc tags.
87-
release = version_str
90+
release = VERSION_STR
8891

8992
# The language for content autogenerated by Sphinx. Refer to documentation
9093
# for a list of supported languages.
91-
#language = None
94+
# language = None
9295

9396
# There are two options for replacing |today|: either, you set today to some
9497
# non-false value, then it is used:
95-
#today = ''
98+
# today = ''
9699
# Else, today_fmt is used as the format for a strftime call.
97-
#today_fmt = '%B %d, %Y'
100+
# today_fmt = '%B %d, %Y'
98101

99102
# List of documents that shouldn't be included in the build.
100-
#unused_docs = []
103+
# unused_docs = []
101104

102105
# List of directories, relative to source directory, that shouldn't be searched
103106
# for source files.
104-
exclude_trees = ['_build']
107+
exclude_trees = ["_build"]
105108

106109
# The reST default role (used for this markup: `text`) to use for all documents.
107-
#default_role = None
110+
# default_role = None
108111

109112
# If true, '()' will be appended to :func: etc. cross-reference text.
110-
#add_function_parentheses = True
113+
# add_function_parentheses = True
111114

112115
# If true, the current module name will be prepended to all description
113116
# unit titles (such as .. function::).
114-
#add_module_names = True
117+
# add_module_names = True
115118

116119
# If true, sectionauthor and moduleauthor directives will be shown in the
117120
# output. They are ignored by default.
118-
#show_authors = False
121+
# show_authors = False
119122

120123
# The name of the Pygments (syntax highlighting) style to use.
121-
pygments_style = 'sphinx'
124+
pygments_style = "sphinx"
122125

123126
# A list of ignored prefixes for module index sorting.
124-
#modindex_common_prefix = []
127+
# modindex_common_prefix = []
125128

126129

127130
# -- Options for HTML output ---------------------------------------------------
128131

129132
# The theme to use for HTML and HTML Help pages. Major themes that come with
130133
# Sphinx are currently 'default' and 'sphinxdoc'.
131-
html_theme = 'sphinxdoc'
134+
# html_theme = "sphinxdoc"
135+
html_theme = "sphinx_rtd_theme"
132136

133137
# Theme options are theme-specific and customize the look and feel of a theme
134138
# further. For a list of options available for each theme, see the
135139
# documentation.
136-
#html_theme_options = {}
140+
# html_theme_options = {}
137141

138142
# Add any paths that contain custom themes here, relative to this directory.
139-
#html_theme_path = []
143+
# html_theme_path = []
140144

141145
# The name for this set of Sphinx documents. If None, it defaults to
142146
# "<project> v<release> documentation".
143-
#html_title = None
147+
# html_title = None
144148

145149
# A shorter title for the navigation bar. Default is the same as html_title.
146-
#html_short_title = None
150+
# html_short_title = None
147151

148152
# The name of an image file (relative to this directory) to place at the top
149153
# of the sidebar.
150-
#html_logo = None
154+
# html_logo = None
151155

152156
# The name of an image file (within the static path) to use as favicon of the
153157
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
154158
# pixels large.
155-
#html_favicon = None
159+
# html_favicon = None
156160

157161
# Add any paths that contain custom static files (such as style sheets) here,
158162
# relative to this directory. They are copied after the builtin static files,
159163
# so a file named "default.css" will overwrite the builtin "default.css".
160-
html_static_path = ['_static']
164+
html_static_path = ["_static"]
161165

162166
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
163167
# using the given strftime format.
164-
#html_last_updated_fmt = '%b %d, %Y'
168+
# html_last_updated_fmt = '%b %d, %Y'
165169

166170
# If true, SmartyPants will be used to convert quotes and dashes to
167171
# typographically correct entities.
168-
#html_use_smartypants = True
172+
# html_use_smartypants = True
169173

170174
# Custom sidebar templates, maps document names to template names.
171-
#html_sidebars = {}
175+
# html_sidebars = {}
172176

173177
# Additional templates that should be rendered to pages, maps page names to
174178
# template names.
175-
#html_additional_pages = {}
179+
# html_additional_pages = {}
176180

177181
# If false, no module index is generated.
178-
#html_use_modindex = True
182+
# html_use_modindex = True
179183

180184
# If false, no index is generated.
181-
#html_use_index = True
185+
# html_use_index = True
182186

183187
# If true, the index is split into individual pages for each letter.
184-
#html_split_index = False
188+
# html_split_index = False
185189

186190
# If true, links to the reST sources are added to the pages.
187-
#html_show_sourcelink = True
191+
# html_show_sourcelink = True
188192

189193
# If true, an OpenSearch description file will be output, and all pages will
190194
# contain a <link> tag referring to it. The value of this option must be the
191195
# base URL from which the finished HTML is served.
192-
#html_use_opensearch = ''
196+
# html_use_opensearch = ''
193197

194198
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
195-
#html_file_suffix = ''
199+
# html_file_suffix = ''
196200

197201
# Output file base name for HTML help builder.
198-
htmlhelp_basename = 'python-odmldoc'
202+
htmlhelp_basename = "python-odmldoc"
199203

200204

201205
# -- Options for LaTeX output --------------------------------------------------
202206

203207
# The paper size ('letter' or 'a4').
204-
#latex_paper_size = 'letter'
208+
# latex_paper_size = 'letter'
205209

206210
# The font size ('10pt', '11pt' or '12pt').
207-
#latex_font_size = '10pt'
211+
# latex_font_size = '10pt'
208212

209213
# Grouping the document tree into LaTeX files. List of tuples
210214
# (source start file, target name, title, author, documentclass [howto/manual]).
211-
latex_documents = [
212-
('index', 'python-odml.tex', u'python-odml Documentation',
213-
u'Hagen Fritsch', 'manual'),
214-
]
215+
latex_documents = [('index', 'python-odml.tex', u'python-odml Documentation',
216+
u'Hagen Fritsch', 'manual')]
215217

216218
# The name of an image file (relative to this directory) to place at the top of
217219
# the title page.
218-
#latex_logo = None
220+
# latex_logo = None
219221

220222
# For "manual" documents, if this is true, then toplevel headings are parts,
221223
# not chapters.
222-
#latex_use_parts = False
224+
# latex_use_parts = False
223225

224226
# Additional stuff for the LaTeX preamble.
225-
#latex_preamble = ''
227+
# latex_preamble = ''
226228

227229
# Documents to append as an appendix to all manuals.
228-
#latex_appendices = []
230+
# latex_appendices = []
229231

230232
# If false, no module index is generated.
231-
#latex_use_modindex = True
233+
# latex_use_modindex = True

doc/tutorial.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,22 @@ the project name `python-odml <https://github.com/G-Node/python-odml>`_.
8888
Dependencies
8989
------------
9090

91-
The Python-odML library (version 1.4) runs under Python 2.7 or 3.5.
91+
The Python-odML library (version 1.4+) runs under Python 3.6+.
9292

93-
Additionally, the Python-odML library depends on Enum, lxml, pyyaml and rdflib.
93+
Additionally, the Python-odML library depends on the lxml, pyyaml and rdflib python packages.
9494

9595
When the odML-Python library is installed via pip or the setup.py, these
9696
packages will be automatically downloaded and installed. Alternatively, they
9797
can be installed from the OS package manager.
9898

99-
On Ubuntu, the dependency packages are available as ``python-enum`` and
100-
``python-lxml``.
99+
On Ubuntu, the dependency packages are available as ``python-lxml``, ``python-yaml`` and ``python-rdflib``.
101100

102101
Note that on Ubuntu 14.04, the latter package additionally requires the
103102
installation of ``libxml2-dev``, ``libxslt1-dev``, and ``lib32z1-dev``.
104103

104+
Python 2 has reached end of life. We will not keep any future versions of odml Python 2 compatible and also recommend using a Python version >= 3.6. If a Python version < 3.6 is a requirement, the following dependency needs to be installed as well:
105+
106+
The ``enum34`` package with a ``pip`` installation or ``python-enum`` using the OS package manager.
105107

106108
Installation...
107109
---------------
@@ -120,8 +122,8 @@ downloaded and installed.
120122
If you are not familiar with PyPI and pip, please have a look at the available
121123
online documentation.
122124

123-
Installation
124-
------------
125+
... from source:
126+
****************
125127

126128
To download the Python-odML library please either use git and clone the
127129
repository from GitHub::

odml/info.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"VERSION": "1.4.4",
2+
"VERSION": "1.4.5",
33
"FORMAT_VERSION": "1.1",
44
"AUTHOR": "Hagen Fritsch, Jan Grewe, Christian Kellner, Achilleas Koutsou, Michael Sonntag, Lyuba Zehl",
55
"COPYRIGHT": "(c) 2011-2020, German Neuroinformatics Node",
@@ -8,7 +8,6 @@
88
"CLASSIFIERS": [
99
"Development Status :: 5 - Production/Stable",
1010
"Programming Language :: Python",
11-
"Programming Language :: Python :: 3.5",
1211
"Programming Language :: Python :: 3.6",
1312
"Programming Language :: Python :: 3.7",
1413
"Programming Language :: Python :: 3.8",

0 commit comments

Comments
 (0)