Skip to content

Commit

Permalink
Merge pull request #28 from mslw/template-update
Browse files Browse the repository at this point in the history
Template update
  • Loading branch information
mih authored Nov 7, 2022
2 parents e4008fd + 0118437 commit a843329
Show file tree
Hide file tree
Showing 18 changed files with 914 additions and 431 deletions.
25 changes: 18 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# respective CI run configuration).


# make repository clone cheap
shallow_clone: true
# do not make repository clone cheap: interfers with versioneer
shallow_clone: false


environment:
Expand All @@ -66,7 +66,7 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu2004
INSTALL_SYSPKGS: python3-virtualenv
# system git-annex is way too old, use better one
INSTALL_GITANNEX: git-annex -m deb-url --url http://snapshot.debian.org/archive/debian/20201228T023115Z/pool/main/g/git-annex/git-annex_8.20201127-1_amd64.deb
INSTALL_GITANNEX: git-annex -m deb-url --url http://snapshot.debian.org/archive/debian/20210906T204127Z/pool/main/g/git-annex/git-annex_8.20210903-1_amd64.deb
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# Windows core tests
- ID: WinP39core
Expand All @@ -90,6 +90,13 @@ matrix:
- KNOWN2FAIL: 1


# do not run the CI if only documentation changes were made
# documentation builds are tested elsewhere and cheaper
skip_commits:
files:
- docs/


# it is OK to specify paths that may not exist for a particular test run
cache:
# pip cache
Expand Down Expand Up @@ -155,11 +162,16 @@ install:
)
- sh: python -m pip install datalad-installer${DATALAD_INSTALLER_VERSION:-}
# Missing system software
- sh: "[ -n \"$INSTALL_SYSPKGS\" ] && ( [ \"x${APPVEYOR_BUILD_WORKER_IMAGE}\" = \"xmacOS\" ] && brew install -q ${INSTALL_SYSPKGS} || sudo apt-get install --no-install-recommends -y ${INSTALL_SYSPKGS} ) || true"
- sh: "[ -n \"$INSTALL_SYSPKGS\" ] && ( [ \"x${APPVEYOR_BUILD_WORKER_IMAGE}\" = \"xmacOS\" ] && brew install -q ${INSTALL_SYSPKGS} || { sudo apt-get update -y && sudo apt-get install --no-install-recommends -y ${INSTALL_SYSPKGS}; } ) || true"
# Install git-annex on windows, otherwise INSTALL_SYSPKGS can be used
# deploy git-annex, if desired
- cmd: IF DEFINED INSTALL_GITANNEX datalad-installer --sudo ok %INSTALL_GITANNEX%
- sh: "[ -n \"${INSTALL_GITANNEX}\" ] && datalad-installer --sudo ok ${INSTALL_GITANNEX}"
# in case of a snapshot installation, use the following approach to adjust
# the PATH as necessary
#- sh: "[ -n \"${INSTALL_GITANNEX}\" ] && datalad-installer -E ${HOME}/dlinstaller_env.sh --sudo ok ${INSTALL_GITANNEX}"
# add location of datalad installer results to PATH
#- sh: "[ -f ${HOME}/dlinstaller_env.sh ] && . ${HOME}/dlinstaller_env.sh || true"


#before_build:
Expand All @@ -185,9 +197,8 @@ test_script:
- cmd: md __testhome__
- sh: mkdir __testhome__
- cd __testhome__
# run test selecion (--traverse-namespace needed from Python 3.8 onwards)
- cmd: python -m nose --traverse-namespace -s -v -A "not (turtle)" --with-cov --cover-package datalad_ebrains %DTS%
- sh: python -m nose --traverse-namespace -s -v -A "not (turtle)" --with-cov --cover-package datalad_ebrains ${DTS}
- cmd: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_ebrains --pyargs %DTS%
- sh: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_ebrains --pyargs ${DTS}


after_test:
Expand Down
17 changes: 17 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: "2"
checks:
file-lines:
config:
threshold: 500
plugins:
bandit:
enabled: true
checks:
assert_used:
enabled: false
exclude_patterns:
- "_datalad_buildsupport/"
- "versioneer.py"
- "*/_version.py"
- "tools/"
- "**/tests/"
8 changes: 1 addition & 7 deletions .github/workflows/test_crippledfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,4 @@ jobs:
echo "== mount >>"
mount
echo "<< mount =="
python -m nose -s -v --with-doctest --with-coverage --cover-package datalad_ebrains datalad_ebrains
- name: Report coverage
run: |
python -m coverage xml
curl -Os "https://uploader.codecov.io/latest/linux/codecov"
chmod +x codecov
./codecov
python -m pytest -s -v --doctest-modules --cov=datalad_ebrains --pyargs datalad_ebrains
8 changes: 6 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
include versioneer.py
include datalad_ebrains/_version.py
include CONTRIBUTORS LICENSE versioneer.py
graft _datalad_buildsupport
graft datalad_ebrains
graft docs
prune docs/build
global-exclude *.py[cod]
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ clean:
release-pypi:
# avoid upload of stale builds
test ! -e dist
$(PYTHON) setup.py sdist
python setup.py bdist_wheel --universal
$(PYTHON) setup.py sdist bdist_wheel
twine upload dist/*

update-buildsupport:
Expand Down
2 changes: 1 addition & 1 deletion _datalad_buildsupport/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def _mk_options(self, parser):

def _format_action(self, action):
# determine the required width and the entry label
action_header = self._format_action_invocation(action, doubledash='-\\\\-')
action_header = self._format_action_invocation(action)

if action.help:
help_text = self._expand_help(action)
Expand Down
39 changes: 2 additions & 37 deletions _datalad_buildsupport/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@
import datetime
import os

from distutils.core import Command
from distutils.errors import DistutilsOptionError
from os.path import (
dirname,
join as opj,
)
from setuptools import Command, DistutilsOptionError
from setuptools.config import read_configuration

import versioneer
Expand Down Expand Up @@ -75,7 +74,7 @@ def finalize_options(self):
mod_name, suite_name = self.cmdsuite.split(':')
mod = __import__(mod_name, fromlist=mod_name.split('.'))
suite = getattr(mod, suite_name)
self.cmdlist = [c[2] if len(c) > 2 else c[1].replace('_', '-')
self.cmdlist = [c[2] if len(c) > 2 else c[1].replace('_', '-').lower()
for c in suite[1]]

self.announce('Writing man page(s) to %s' % self.manpath)
Expand Down Expand Up @@ -157,40 +156,6 @@ def run(self):
f.write(formatted)


class BuildRSTExamplesFromScripts(Command):
description = 'Generate RST variants of example shell scripts.'

user_options = [
('expath=', None, 'path to look for example scripts'),
('rstpath=', None, 'output path for RST files'),
]

def initialize_options(self):
self.expath = opj('docs', 'examples')
self.rstpath = opj('docs', 'source', 'generated', 'examples')

def finalize_options(self):
if self.expath is None:
raise DistutilsOptionError('\'expath\' option is required')
if self.rstpath is None:
raise DistutilsOptionError('\'rstpath\' option is required')
self.announce('Converting example scripts')

def run(self):
opath = self.rstpath
if not os.path.exists(opath):
os.makedirs(opath)

from glob import glob
for example in glob(opj(self.expath, '*.sh')):
exname = os.path.basename(example)[:-3]
with open(opj(opath, '{0}.rst'.format(exname)), 'w') as out:
fmt.cmdline_example_to_rst(
open(example),
out=out,
ref='_example_{0}'.format(exname))


class BuildConfigInfo(Command):
description = 'Generate RST documentation for all config items.'

Expand Down
5 changes: 2 additions & 3 deletions datalad_ebrains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@
from datalad import setup_package
from datalad import teardown_package

from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
from . import _version
__version__ = _version.get_versions()['version']
Loading

0 comments on commit a843329

Please sign in to comment.