Skip to content

Commit

Permalink
Merge pull request psychoinformatics-de#5 from mih/master
Browse files Browse the repository at this point in the history
Modernization
  • Loading branch information
mih committed Jun 10, 2020
2 parents a836e6b + 1a56499 commit ea1ed84
Show file tree
Hide file tree
Showing 26 changed files with 2,952 additions and 83 deletions.
1 change: 1 addition & 0 deletions .gitattributes
@@ -0,0 +1 @@
datalad_helloworld/_version.py export-subst
27 changes: 27 additions & 0 deletions .github/workflows/docbuild.yml
@@ -0,0 +1,27 @@
name: docs

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Set up environment
run: |
git config --global user.email "test@github.land"
git config --global user.name "GitHub Almighty"
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-devel.txt
pip install .
- name: Build docs
run: |
make -C docs html
33 changes: 0 additions & 33 deletions .github/workflows/main.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/test_crippledfs.yml
@@ -0,0 +1,55 @@
name: crippled-filesystems

on: [pull_request]

jobs:
test:

runs-on: ubuntu-latest

steps:
- name: Set up system
shell: bash
run: |
bash <(wget -q -O- http://neuro.debian.net/_files/neurodebian-travis.sh)
# enable repo for devel git-annex, if needed
#sudo sed -e 's|\(deb.*data\)|#\1|' -e 's|/debian |/debian-devel |' /etc/apt/sources.list.d/neurodebian.sources.list | sudo tee /etc/apt/sources.list.d/neurodebian-devel.sources.list
sudo apt-get update -qq
sudo apt-get install eatmydata
sudo eatmydata apt-get install git-annex-standalone dosfstools
# 500 MB VFAT FS in a box
sudo dd if=/dev/zero of=/crippledfs.img count=500 bs=1M
sudo mkfs.vfat /crippledfs.img
# mount
sudo mkdir /crippledfs
sudo mount -o "uid=$(id -u),gid=$(id -g)" /crippledfs.img /crippledfs
- name: Set up environment
run: |
git config --global user.email "test@github.land"
git config --global user.name "GitHub Almighty"
- uses: actions/checkout@v1
- name: Set up Python 3.5
uses: actions/setup-python@v1
with:
python-version: 3.5
- name: Install dependencies
run: |
pip install -r requirements-devel.txt
python -m pip install --upgrade pip
- name: Installation
run: |
# package install
python -m pip install .
- name: Run tests
env:
# forces all test repos/paths into the VFAT FS
TMPDIR: /crippledfs
run: |
mkdir -p __testhome__
cd __testhome__
# give detailed info on actual test setup
datalad wtf
echo "== mount >>"
mount
echo "<< mount =="
python -m nose -s -v --with-doctest --with-coverage --cover-package datalad_helloworld datalad_helloworld
47 changes: 47 additions & 0 deletions .github/workflows/test_win2019.yml
@@ -0,0 +1,47 @@
name: win2019

on: [push, pull_request]

jobs:
test:

runs-on: windows-2019

steps:
- name: Configure windows system
run: |
# https://support.microsoft.com/en-us/help/121007/how-to-disable-8-3-file-name-creation-on-ntfs-partitions
fsutil.exe behavior set disable8dot3 1
- name: Set up environment
run: |
git config --global user.email "test@github.land"
git config --global user.name "GitHub Almighty"
- uses: actions/checkout@v1
# on windows it makes sense to aim for the latest, nothing comes with the system
# anyways
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Set up git-annex
run: |
# latest version
python -c "import urllib.request as r; r.urlretrieve('https://downloads.kitenet.net/git-annex/windows/current/git-annex-installer.exe', 'C:\\git-annex-installer.exe')"
# specific version mih uses to debug on real win10 box
7z x -o"C:\\Program Files\Git" C:\\git-annex-installer.exe
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-devel.txt
pip install colorama
- name: Installation
run: |
# package install
python -m pip install .
- name: Run tests
run: |
mkdir -p __testhome__
cd __testhome__
# give detailed info on actual test setup
datalad wtf
python -m nose -s -v --with-doctest --with-coverage --cover-package datalad_helloworld datalad_helloworld
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -5,5 +5,8 @@
*.py[coe]
.#*
.*.swp
pip-wheel-metadata
docs/build
docs/source/generated
build/
dist/
Empty file added .noannex
Empty file.
31 changes: 13 additions & 18 deletions .travis.yml
Expand Up @@ -3,9 +3,10 @@
language: python

python:
- 2.7
# minium version
- 3.5
- 3.6
# "latest"
- 3.8

cache:
- apt
Expand All @@ -14,18 +15,12 @@ env:
global:
# will be used in the matrix, where neither other variable is used
- BOTO_CONFIG=/tmp/nowhere
- DATALAD_TESTS_SSH=1
- DATALAD_LOG_CMD_ENV=GIT_SSH_COMMAND
- TESTS_TO_PERFORM=
- TESTS_TO_PERFORM=datalad_helloworld
- NOSE_OPTS=-s
- NOSE_SELECTION_OP="not " # so it would be "not (integration or usecase)"
# Special settings/helper for combined coverage from special remotes execution
- COVERAGE=coverage
- DATALAD_DATASETS_TOPURL=http://datasets-tests.datalad.org
matrix:
- DATALAD_REPO_VERSION=5
- DATALAD_REPO_VERSION=6


before_install:
# Just in case we need to check if nfs is there etc
Expand All @@ -37,12 +32,12 @@ before_install:

install:
# Install standalone build of git-annex for the recent enough version
- travis_retry sudo eatmydata apt-get install zip pandoc
- travis_retry sudo eatmydata apt-get install zip git-annex-standalone
# for metadata support
- git config --global user.email "test@travis.land"
- git config --global user.name "Travis Almighty"
- cd ..; pip install -q codecov; cd -
- pip install -r requirements.txt
- pip install -r requirements-devel.txt
#- pip install 'sphinx>=1.6.2'
# So we could test under sudo -E with PATH pointing to installed location
- sudo sed -i -e 's/^Defaults.*secure_path.*$//' /etc/sudoers
Expand All @@ -52,20 +47,20 @@ script:
- python setup.py build
# Test installation system-wide
- sudo pip install .
- mkdir -p __testhome__
- cd __testhome__
# Report WTF information using system wide installed version
- datalad wtf
# Run tests
- http_proxy=
PATH=$PWD/tools/coverage-bin:$PATH
$NOSE_WRAPPER `which nosetests` $NOSE_OPTS
-v -A "$NOSE_SELECTION_OP(integration or usecase or slow)"
-v
--with-doctest
--with-cov --cover-package datalad_helloworld
--with-coverage --cover-package datalad_helloworld
--logging-level=INFO
$TESTS_TO_PERFORM
#- if [ ! "${DATALAD_LOG_LEVEL:-}" = 2 ]; then
# PYTHONPATH=$PWD $NOSE_WRAPPER make -C docs html doctest;
# fi
# Report WTF information using system wide installed version
- datalad wtf
- cd ..

after_success:
- coverage combine -a /tmp/.coverage-entrypoints-*
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
include versioneer.py
include datalad_helloworld/_version.py
14 changes: 14 additions & 0 deletions Makefile
@@ -0,0 +1,14 @@
PYTHON ?= python

clean:
$(PYTHON) setup.py clean
rm -rf dist build bin docs/build docs/source/generated *.egg-info
-find . -name '*.pyc' -delete
-find . -name '__pycache__' -type d -delete

release-pypi:
# avoid upload of stale builds
test ! -e dist
$(PYTHON) setup.py sdist
python setup.py bdist_wheel --universal
twine upload dist/*
3 changes: 2 additions & 1 deletion README.md
@@ -1,6 +1,7 @@
# DataLad extension template

[![Travis tests status](https://secure.travis-ci.org/datalad/datalad-extension-template.png?branch=master)](https://travis-ci.org/datalad/datalad-extension-template) [![codecov.io](https://codecov.io/github/datalad/datalad-extension-template/coverage.svg?branch=master)](https://codecov.io/github/datalad/datalad-extension-template?branch=master)
[![Travis tests status](https://secure.travis-ci.org/datalad/datalad-extension-template.png?branch=master)](https://travis-ci.org/datalad/datalad-extension-template) [![codecov.io](https://codecov.io/github/datalad/datalad-extension-template/coverage.svg?branch=master)](https://codecov.io/github/datalad/datalad-extension-template?branch=master) [![crippled-filesystems](https://github.com/datalad/datalad-extension-template/workflows/crippled-filesystems/badge.svg)](https://github.com/datalad/datalad-extension-template/actions?query=workflow%3Acrippled-filesystems) [![win2019](https://github.com/datalad/datalad-extension-template/workflows/win2019/badge.svg)](https://github.com/datalad/datalad-extension-template/actions?query=workflow%3Awin2019) [![docs](https://github.com/datalad/datalad-extension-template/workflows/docs/badge.svg)](https://github.com/datalad/datalad-extension-template/actions?query=workflow%3Adocs)


This repository contains an extension template that can serve as a starting point
for implementing a [DataLad](http://datalad.org) extension. An extension can
Expand Down
6 changes: 5 additions & 1 deletion datalad_helloworld/__init__.py
Expand Up @@ -30,7 +30,7 @@
# optional name of the command in the cmdline API
'hello-cmd',
# optional name of the command in the Python API
'hello_py'
'hello_cmd'
),
]
)
Expand Down Expand Up @@ -95,3 +95,7 @@ def __call__(language='en'):

from datalad import setup_package
from datalad import teardown_package

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

0 comments on commit ea1ed84

Please sign in to comment.