Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kick off #65

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ environment:

# Ubuntu core tests
- ID: Ubu20
DTS: datalad_helloworld
DTS: datalad_ria
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/20210906T204127Z/pool/main/g/git-annex/git-annex_8.20210903-1_amd64.deb
INSTALL_GITANNEX: git-annex -m snapshot
CODECOV_BINARY: https://uploader.codecov.io/latest/linux/codecov
# Windows core tests
- ID: WinP39core
# ~35 min
DTS: datalad_helloworld
DTS: datalad_ria
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# Python version specification is non-standard on windows
PY: 39-x64
INSTALL_GITANNEX: git-annex -m datalad/packages
# MacOS core tests
- ID: MacP38core
DTS: datalad_helloworld
DTS: datalad_ria
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
PY: 3.8
INSTALL_GITANNEX: git-annex
Expand Down Expand Up @@ -197,8 +197,8 @@ test_script:
- cmd: md __testhome__
- sh: mkdir __testhome__
- cd __testhome__
- cmd: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_helloworld --pyargs %DTS%
- sh: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_helloworld --pyargs ${DTS}
- cmd: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_ria --pyargs %DTS%
- sh: python -m pytest -s -v -m "not (turtle)" --doctest-modules --cov=datalad_ria --pyargs ${DTS}


after_test:
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
datalad_helloworld/_version.py export-subst
datalad_ria/_version.py export-subst
2 changes: 1 addition & 1 deletion .github/workflows/test_crippledfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
echo "== mount >>"
mount
echo "<< mount =="
python -m pytest -s -v --doctest-modules --cov=datalad_helloworld --pyargs datalad_helloworld
python -m pytest -s -v --doctest-modules --cov=datalad_ria --pyargs datalad_ria
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include CONTRIBUTORS LICENSE versioneer.py
graft _datalad_buildsupport
graft datalad_helloworld
graft datalad_ria
graft docs
prune docs/build
global-exclude *.py[cod]
48 changes: 16 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,36 @@
# DataLad extension template
# DataLad RIA tools

[![Build status](https://ci.appveyor.com/api/projects/status/g9von5wtpoidcecy/branch/main?svg=true)](https://ci.appveyor.com/project/mih/datalad-extension-template/branch/main) [![codecov.io](https://codecov.io/github/datalad/datalad-extension-template/coverage.svg?branch=main)](https://codecov.io/github/datalad/datalad-extension-template?branch=main) [![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) [![docs](https://github.com/datalad/datalad-extension-template/workflows/docs/badge.svg)](https://github.com/datalad/datalad-extension-template/actions?query=workflow%3Adocs)

This datalad extension will contain a modernized and improved implementation for RIA-related functionality.
It is currently a work-in-progress.

This repository contains an extension template that can serve as a starting point
for implementing a [DataLad](http://datalad.org) extension. An extension can
provide any number of additional DataLad commands that are automatically
included in DataLad's command line and Python API.
TODOs:

For a demo, clone this repository and install the demo extension via

pip install -e .

DataLad will now expose a new command suite with a `hello...` command.

% datalad --help |grep -B2 -A2 hello
*Demo DataLad command suite*

hello-cmd
Short description of the command

To start implementing your own extension, [use this
template](https://github.com/datalad/datalad-extension-template/generate), and
adjust as necessary. A good approach is to

- Pick a name for the new extension.
- Look through the sources and replace `helloworld` with
- [x] Pick a name for the new extension.
- [x] Look through the sources and replace `helloworld` with
`<newname>` (hint: `git grep helloworld` should find all
spots).
- Delete the example command implementation in `datalad_helloworld/hello_cmd.py`.
- Implement a new command, and adjust the `command_suite` in
- [ ] Delete the example command implementation in `datalad_helloworld/hello_cmd.py`.
- [ ] Implement a new command, and adjust the `command_suite` in
`datalad_helloworld/__init__.py` to point to it.
- Replace `hello_cmd` with the name of the new command in
- [ ] Replace `hello_cmd` with the name of the new command in
`datalad_helloworld/tests/test_register.py` to automatically test whether the
new extension installs correctly.
- Adjust the documentation in `docs/source/index.rst`. Refer to [`docs/README.md`](docs/README.md) for more information on documentation building, testing and publishing.
- Replace this README, and/or update the links in the badges at the top.
- Update `setup.cfg` with appropriate metadata on the new extension.
- Generate GitHub labels for use by the "Add changelog.d snippet" and
- [ ] Adjust the documentation in `docs/source/index.rst`. Refer to [`docs/README.md`](docs/README.md) for more information on documentation building, testing and publishing.
- [ ] Replace this README, and/or update the links in the badges at the top.
- [x] Update `setup.cfg` with appropriate metadata on the new extension.
- [ ] Generate GitHub labels for use by the "Add changelog.d snippet" and
"Auto-release on PR merge" workflows by using the code in the
`datalad/release-action` repository [as described in its
README](https://github.com/datalad/release-action#command-labels).

You can consider filling in the provided [.zenodo.json](.zenodo.json) file with
- [ ] You can consider filling in the provided [.zenodo.json](.zenodo.json) file with
contributor information and [meta data](https://developers.zenodo.org/#representation)
to acknowledge contributors and describe the publication record that is created when
[you make your code citeable](https://guides.github.com/activities/citable-code/)
by archiving it using [zenodo.org](https://zenodo.org/). You may also want to
by archiving it using [zenodo.org](https://zenodo.org/).
- [ ] You may also want to
consider acknowledging contributors with the
[allcontributors bot](https://allcontributors.org/docs/en/bot/overview).

Expand Down
4 changes: 2 additions & 2 deletions changelog.d/templates/new_fragment.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### {{ cat }}

- Describe change, possibly reference closed/related issue/PR.
Fixes https://github.com/datalad/datalad-helloworld/issues/XXX via
https://github.com/datalad/datalad-helloworld/pull/XXX (by [@GITHUBHANDLE](https://github.com/GITHUBHANDLE))
Fixes https://github.com/datalad/datalad-ria/issues/XXX via
https://github.com/datalad/datalad-ria/pull/XXX (by [@GITHUBHANDLE](https://github.com/GITHUBHANDLE))
-->
{% endfor -%}
6 changes: 3 additions & 3 deletions datalad_helloworld/__init__.py → datalad_ria/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
__docformat__ = 'restructuredtext'

import logging
lgr = logging.getLogger('datalad.helloworld')
lgr = logging.getLogger('datalad.ria')

# Defines a datalad command suite.
# This variable must be bound as a setuptools entrypoint
# to be found by datalad
command_suite = (
# description of the command suite, displayed in cmdline help
"Demo DataLad command suite",
"DataLad-ria command suite",
[
# specification of a command, any number of commands can be defined
(
# importable module that contains the command implementation
'datalad_helloworld.hello_cmd',
'datalad_ria.hello_cmd',
# name of the command class implementation in above module
'HelloWorld',
# optional name of the command in the cmdline API
Expand Down
2 changes: 1 addition & 1 deletion datalad_helloworld/_version.py → datalad_ria/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_config():
cfg.style = "pep440"
cfg.tag_prefix = ""
cfg.parentdir_prefix = ""
cfg.versionfile_source = "datalad_helloworld/_version.py"
cfg.versionfile_source = "datalad_ria/_version.py"
cfg.verbose = False
return cfg

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from datalad.interface.results import get_status_dict

import logging
lgr = logging.getLogger('datalad.helloworld.hello_cmd')
lgr = logging.getLogger('datalad.ria.hello_cmd')


# decoration auto-generates standard help
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ qthelp:
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/datalad_helloworld.qhcp"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/datalad_ria.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/datalad_helloworld.qhc"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/datalad_ria.qhc"

applehelp:
$(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
Expand All @@ -104,8 +104,8 @@ devhelp:
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/datalad_helloworld"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/datalad_helloworld"
@echo "# mkdir -p $$HOME/.local/share/devhelp/datalad_ria"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/datalad_ria"
@echo "# devhelp"

epub:
Expand Down
8 changes: 4 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# datalad_helloworld documentation build configuration file, created by
# datalad_ria documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 13 08:41:19 2015.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -24,7 +24,7 @@
)
from os import pardir

import datalad_helloworld
import datalad_ria

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -40,7 +40,7 @@
try:
subprocess.run(
args=[setup_py_path, 'build_manpage',
'--cmdsuite', 'datalad_helloworld:command_suite',
'--cmdsuite', 'datalad_ria:command_suite',
'--manpath', abspath(opj(
dirname(setup_py_path), 'build', 'man')),
'--rstpath', opj(dirname(__file__), 'generated', 'man'),
Expand Down Expand Up @@ -95,7 +95,7 @@
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
version = datalad_helloworld.__version__
version = datalad_ria.__version__
release = version

# The language for content autogenerated by Sphinx. Refer to documentation
Expand Down
4 changes: 4 additions & 0 deletions docs/source/design.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _design:

RIA Design
**********
5 changes: 5 additions & 0 deletions docs/source/for_admins.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.. _admindocs:

For administrators and data managers
************************************

20 changes: 16 additions & 4 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
DataLad extension template
**************************
DataLad-ria extension
*********************

This is a template for creating a `DataLad <http://datalad.org>`__ extension
that equips DataLad with additional functionality.
This is a DataLad extension with modernized replacements for the RIA functionality
in DataLad versions 0.13-0.19.X.
It is currently under development.


API
===

DataLad-ria Guides
------------------

.. toctree::
:maxdepth: 1

quickstart.rst
design.rst
usage_examples.rst
for_admins.rst

High-level API commands
-----------------------

Expand Down
4 changes: 4 additions & 0 deletions docs/source/quickstart.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _quickstart:

Quickstart
**********
4 changes: 4 additions & 0 deletions docs/source/usage_examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. _usage:

DataLad-RIA usage examples
**************************
26 changes: 26 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py


formats: all

# Optionally declare the Python requirements required to build your docs
python:
install:
- path: .
method: pip
- requirements: requirements-devel.txt
16 changes: 8 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
url = https://github.com/datalad/datalad-extension-template
author = The DataLad Team and Contributors
author_email = team@datalad.org
description = demo DataLad extension package
description = DataLad-ria extension
long_description = file:README.md
long_description_content_type = text/markdown; charset=UTF-8
license = MIT
Expand All @@ -12,14 +12,14 @@ classifiers =
Programming Language :: Python :: 3

[options]
python_requires = >= 3.7
python_requires = >= 3.8
install_requires =
datalad >= 0.18.0
datalad >= 0.19.0
packages = find_namespace:
include_package_data = True

[options.packages.find]
include = datalad_helloworld*
include = datalad_ria*

[options.extras_require]
# this matches the name used by -core and what is expected by some CI setups
Expand All @@ -39,21 +39,21 @@ datalad.extensions =
# the label in front of '=' is the command suite label
# the entrypoint can point to any symbol of any name, as long it is
# valid datalad interface specification (see demo in this extensions)
helloworld = datalad_helloworld:command_suite
ria = datalad_ria:command_suite

[versioneer]
# See the docstring in versioneer.py for instructions. Note that you must
# re-run 'versioneer.py setup' after changing this section, and commit the
# resulting files.
VCS = git
style = pep440
versionfile_source = datalad_helloworld/_version.py
versionfile_build = datalad_helloworld/_version.py
versionfile_source = datalad_ria/_version.py
versionfile_build = datalad_ria/_version.py
tag_prefix =
parentdir_prefix =

[coverage:report]
show_missing = True
omit =
# versioneer code
datalad_helloworld/_version.py
datalad_ria/_version.py
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
cmdclass.update(build_manpage=BuildManPage)

if __name__ == '__main__':
setup(name='datalad_helloworld',
setup(name='datalad_ria',
version=versioneer.get_version(),
cmdclass=cmdclass,
)