Commit f1af4910 authored by Jan Kotanski's avatar Jan Kotanski
Browse files

New upstream version 0.7.0

parent 0f373af5
language: python
python:
- 3.9
- 3.8
- 3.7
- 3.6
install:
pip install . -r requirements.txt
script:
pytest
......@@ -4,7 +4,7 @@ Licensing Terms for NeXpy
NeXpy is licensed under the terms of the Modified BSD License (also known as
New or Revised BSD), as follows:
Copyright (c) 2014, NeXpy Development Team
Copyright (c) 2014-2020, NeXpy Development Team
All rights reserved.
......@@ -47,7 +47,7 @@ The following banner should be used in any source code file to indicate the
copyright and license terms:
#-----------------------------------------------------------------------------
# Copyright (c) 2014, NeXpy Development Team.
# Copyright (c) 2014-2020, NeXpy Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
......
include versioneer.py
include src/nexusformat/_version.py
include src/notebooks/*.ipynb
include COPYING
Metadata-Version: 1.2
Name: nexusformat
Version: 0.7.0
Summary: nexusformat: Python API to access NeXus data
Home-page: http://nexpy.github.io/nexpy/
Author: NeXpy Development Team
Author-email: nexpydev@gmail.com
License: BSD
Download-URL: https://github.com/nexpy/nexusformat/
Description:
This package provides a Python API to open, create, and manipulate `NeXus data
<http://www.nexusformat.org/>`_ written in the HDF5 format. The 'nexusformat'
package provides the underlying API for `NeXpy
<http://nexpy.github.io/nexpy>`_, which provides a GUI interface. It also
contains a command-line script, `nxstack` for merging TIFF or CBF files into a
single HDF5 array.
The latest development version is always available from `NeXpy's GitHub
site <https://github.com/nexpy/nexusformat>`_.
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.6
package:
name: nexusformat
version: "0.4.19"
version: "0.7.0"
source:
git_url: https://github.com/nexpy/nexusformat.git
git_tag: v0.4.19
git_tag: v0.7.0
build:
entry_points:
- nxstack = nexusformat.scripts.nxstack:main
- nxduplicate = nexusformat.scripts.nxduplicate:main
number: 0
requirements:
build:
- python
- python >=3.6
- setuptools
- numpy >=1.6.0
- h5py
- versioneer
run:
- python
- numpy >=1.6.0
- python >=3.6
- numpy >=1.16
- h5py
- versioneer
test:
imports:
- nexusformat
- nexusformat.nexus
commands:
- nexusformat --version
- pytest
about:
home: http://nexpy.github.io/nexusformat/
......
[bdist_rpm]
requires = h5py,numpy,scipy
[versioneer]
VCS = git
vcs = git
style = pep440
versionfile_source = src/nexusformat/_version.py
versionfile_build = nexusformat/_version.py
tag_prefix = v
[egg_info]
tag_build =
tag_date = 0
......@@ -10,9 +10,6 @@
from setuptools import setup, find_packages, Extension
import os, sys
import pkg_resources
pkg_resources.require('numpy')
import numpy
import versioneer
# pull in some definitions from the package's __init__.py file
......@@ -33,26 +30,27 @@ setup (name = nexusformat.__package_name__, # NeXpy
url=nexusformat.__url__,
download_url=nexusformat.__download_url__,
platforms='any',
python_requires='>=3.6',
install_requires = nexusformat.requires.pkg_requirements,
package_dir = {'': 'src'},
packages = find_packages('src'),
entry_points={
# create & install scripts in <python>/bin
'console_scripts': ['nxstack=nexusformat.scripts.nxstack:main'],
'console_scripts':
['nxstack=nexusformat.scripts.nxstack:main',
'nxduplicate=nexusformat.scripts.nxduplicate:main',
'nexusformat=nexusformat.scripts.nexusformat:main'],
},
classifiers= ['Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Visualization'],
)
Metadata-Version: 1.2
Name: nexusformat
Version: 0.7.0
Summary: nexusformat: Python API to access NeXus data
Home-page: http://nexpy.github.io/nexpy/
Author: NeXpy Development Team
Author-email: nexpydev@gmail.com
License: BSD
Download-URL: https://github.com/nexpy/nexusformat/
Description:
This package provides a Python API to open, create, and manipulate `NeXus data
<http://www.nexusformat.org/>`_ written in the HDF5 format. The 'nexusformat'
package provides the underlying API for `NeXpy
<http://nexpy.github.io/nexpy>`_, which provides a GUI interface. It also
contains a command-line script, `nxstack` for merging TIFF or CBF files into a
single HDF5 array.
The latest development version is always available from `NeXpy's GitHub
site <https://github.com/nexpy/nexusformat>`_.
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.6
.gitattributes
.gitignore
.travis.yml
COPYING
MANIFEST.in
README
README.md
README.rst
nexusformat.spec
requirements.txt
setup.cfg
setup.py
versioneer.py
conda-recipe/bld.bat
conda-recipe/build.sh
conda-recipe/meta.yaml
src/nexusformat/__init__.py
src/nexusformat/_version.py
src/nexusformat/requires.py
src/nexusformat.egg-info/PKG-INFO
src/nexusformat.egg-info/SOURCES.txt
src/nexusformat.egg-info/dependency_links.txt
src/nexusformat.egg-info/entry_points.txt
src/nexusformat.egg-info/requires.txt
src/nexusformat.egg-info/top_level.txt
src/nexusformat/nexus/__init__.py
src/nexusformat/nexus/completer.py
src/nexusformat/nexus/lock.py
src/nexusformat/nexus/plot.py
src/nexusformat/nexus/remote.py
src/nexusformat/nexus/tree.py
src/nexusformat/notebooks/nexusformat.ipynb
src/nexusformat/scripts/__init__.py
src/nexusformat/scripts/nexusformat.py
src/nexusformat/scripts/nxduplicate.py
src/nexusformat/scripts/nxstack.py
tests/test_data.py
tests/test_entry_groups.py
tests/test_fields.py
tests/test_files.py
tests/test_groups.py
tests/test_links.py
tests/test_locks.py
tests/test_masks.py
tests/test_paths.py
\ No newline at end of file
[console_scripts]
nexusformat = nexusformat.scripts.nexusformat:main
nxduplicate = nexusformat.scripts.nxduplicate:main
nxstack = nexusformat.scripts.nxstack:main
h5py
numpy>=1.16
scipy
versioneer
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file was generated by 'versioneer.py' (0.19) from
# revision-control system data, or from the parent directory name of an
# unpacked source archive. Distribution tarballs contain a pre-generated copy
# of this file.
# This file is released into the public domain. Generated by
# versioneer-0.15 (https://github.com/warner/python-versioneer)
import json
import errno
import os
import re
import subprocess
import sys
def get_keywords():
# these strings will be replaced by git during git-archive.
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
git_refnames = " (tag: v0.4.20)"
git_full = "e1e6689b1651b8b7217158528336b80d8f126113"
keywords = {"refnames": git_refnames, "full": git_full}
return keywords
class VersioneerConfig:
pass
def get_config():
# these strings are filled in when 'setup.py versioneer' creates
# _version.py
cfg = VersioneerConfig()
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "None"
cfg.versionfile_source = "src/nexusformat/_version.py"
cfg.verbose = False
return cfg
class NotThisMethod(Exception):
pass
LONG_VERSION_PY = {}
HANDLERS = {}
def register_vcs_handler(vcs, method): # decorator
def decorate(f):
if vcs not in HANDLERS:
HANDLERS[vcs] = {}
HANDLERS[vcs][method] = f
return f
return decorate
def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False):
assert isinstance(commands, list)
p = None
for c in commands:
try:
dispcmd = str([c] + args)
# remember shell=False, so use git.cmd on windows, not just git
p = subprocess.Popen([c] + args, cwd=cwd, stdout=subprocess.PIPE,
stderr=(subprocess.PIPE if hide_stderr
else None))
break
except EnvironmentError:
e = sys.exc_info()[1]
if e.errno == errno.ENOENT:
continue
if verbose:
print("unable to run %s" % dispcmd)
print(e)
return None
else:
if verbose:
print("unable to find command, tried %s" % (commands,))
return None
stdout = p.communicate()[0].strip()
if sys.version_info[0] >= 3:
stdout = stdout.decode()
if p.returncode != 0:
if verbose:
print("unable to run %s (error)" % dispcmd)
return None
return stdout
def versions_from_parentdir(parentdir_prefix, root, verbose):
# Source tarballs conventionally unpack into a directory that includes
# both the project name and a version string.
dirname = os.path.basename(root)
if not dirname.startswith(parentdir_prefix):
if verbose:
print("guessing rootdir is '%s', but '%s' doesn't start with "
"prefix '%s'" % (root, dirname, parentdir_prefix))
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
return {"version": dirname[len(parentdir_prefix):],
"full-revisionid": None,
"dirty": False, "error": None}
@register_vcs_handler("git", "get_keywords")
def git_get_keywords(versionfile_abs):
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
# _version.py.
keywords = {}
try:
f = open(versionfile_abs, "r")
for line in f.readlines():
if line.strip().startswith("git_refnames ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["refnames"] = mo.group(1)
if line.strip().startswith("git_full ="):
mo = re.search(r'=\s*"(.*)"', line)
if mo:
keywords["full"] = mo.group(1)
f.close()
except EnvironmentError:
pass
return keywords
@register_vcs_handler("git", "keywords")
def git_versions_from_keywords(keywords, tag_prefix, verbose):
if not keywords:
raise NotThisMethod("no keywords at all, weird")
refnames = keywords["refnames"].strip()
if refnames.startswith("$Format"):
if verbose:
print("keywords are unexpanded, not using")
raise NotThisMethod("unexpanded keywords, not a git-archive tarball")
refs = set([r.strip() for r in refnames.strip("()").split(",")])
# starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead of
# just "foo-1.0". If we see a "tag: " prefix, prefer those.
TAG = "tag: "
tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])
if not tags:
# Either we're using git < 1.8.3, or there really are no tags. We use
# a heuristic: assume all version tags have a digit. The old git %d
# expansion behaves like git log --decorate=short and strips out the
# refs/heads/ and refs/tags/ prefixes that would let us distinguish
# between branches and tags. By ignoring refnames without digits, we
# filter out many common branch names like "release" and
# "stabilization", as well as "HEAD" and "master".
tags = set([r for r in refs if re.search(r'\d', r)])
if verbose:
print("discarding '%s', no digits" % ",".join(refs-tags))
if verbose:
print("likely tags: %s" % ",".join(sorted(tags)))
for ref in sorted(tags):
# sorting will prefer e.g. "2.0" over "2.0rc1"
if ref.startswith(tag_prefix):
r = ref[len(tag_prefix):]
if verbose:
print("picking %s" % r)
return {"version": r,
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": None
}
# no suitable tags, so version is "0+unknown", but full hex is still there
if verbose:
print("no suitable tags, using unknown + full revision id")
return {"version": "0+unknown",
"full-revisionid": keywords["full"].strip(),
"dirty": False, "error": "no suitable tags"}
@register_vcs_handler("git", "pieces_from_vcs")
def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
# this runs 'git' from the root of the source tree. This only gets called
# if the git-archive 'subst' keywords were *not* expanded, and
# _version.py hasn't already been rewritten with a short version string,
# meaning we're inside a checked out source tree.
if not os.path.exists(os.path.join(root, ".git")):
if verbose:
print("no .git in %s" % root)
raise NotThisMethod("no .git directory")
GITS = ["git"]
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
# if there is a tag, this yields TAG-NUM-gHEX[-dirty]
# if there are no tags, this yields HEX[-dirty] (no NUM)
describe_out = run_command(GITS, ["describe", "--tags", "--dirty",
"--always", "--long"],
cwd=root)
# --long was added in git-1.5.5
if describe_out is None:
raise NotThisMethod("'git describe' failed")
describe_out = describe_out.strip()
full_out = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)
if full_out is None:
raise NotThisMethod("'git rev-parse' failed")
full_out = full_out.strip()
pieces = {}
pieces["long"] = full_out
pieces["short"] = full_out[:7] # maybe improved later
pieces["error"] = None
# parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]
# TAG might have hyphens.
git_describe = describe_out
# look for -dirty suffix
dirty = git_describe.endswith("-dirty")
pieces["dirty"] = dirty
if dirty:
git_describe = git_describe[:git_describe.rindex("-dirty")]
# now we have TAG-NUM-gHEX or HEX
if "-" in git_describe:
# TAG-NUM-gHEX
mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)
if not mo:
# unparseable. Maybe git-describe is misbehaving?
pieces["error"] = ("unable to parse git-describe output: '%s'"
% describe_out)
return pieces
# tag
full_tag = mo.group(1)
if not full_tag.startswith(tag_prefix):
if verbose:
fmt = "tag '%s' doesn't start with prefix '%s'"
print(fmt % (full_tag, tag_prefix))
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
% (full_tag, tag_prefix))
return pieces
pieces["closest-tag"] = full_tag[len(tag_prefix):]
# distance: number of commits since tag
pieces["distance"] = int(mo.group(2))
# commit: short hex revision ID
pieces["short"] = mo.group(3)
else:
# HEX: no tags
pieces["closest-tag"] = None
count_out = run_command(GITS, ["rev-list", "HEAD", "--count"],
cwd=root)
pieces["distance"] = int(count_out) # total number of commits
return pieces
def plus_or_dot(pieces):
if "+" in pieces.get("closest-tag", ""):
return "."
return "+"
def render_pep440(pieces):
# now build up version string, with post-release "local version
# identifier". Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
# get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty
# exceptions:
# 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += plus_or_dot(pieces)
rendered += "%d.g%s" % (pieces["distance"], pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
else:
# exception #1
rendered = "0+untagged.%d.g%s" % (pieces["distance"],
pieces["short"])
if pieces["dirty"]:
rendered += ".dirty"
return rendered
def render_pep440_pre(pieces):
# TAG[.post.devDISTANCE] . No -dirty
# exceptions:
# 1: no tags. 0.post.devDISTANCE
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"]:
rendered += ".post.dev%d" % pieces["distance"]
else:
# exception #1
rendered = "0.post.dev%d" % pieces["distance"]
return rendered
def render_pep440_post(pieces):
# TAG[.postDISTANCE[.dev0]+gHEX] . The ".dev0" means dirty. Note that
# .dev0 sorts backwards (a dirty tree will appear "older" than the
# corresponding clean one), but you shouldn't be releasing software with
# -dirty anyways.
# exceptions:
# 1: no tags. 0.postDISTANCE[.dev0]
if pieces["closest-tag"]:
rendered = pieces["closest-tag"]
if pieces["distance"] or pieces["dirty"]:
rendered += ".post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += plus_or_dot(pieces)
rendered += "g%s" % pieces["short"]
else:
# exception #1
rendered = "0.post%d" % pieces["distance"]
if pieces["dirty"]:
rendered += ".dev0"
rendered += "+g%s" % pieces["short"]