Skip to content

Commit

Permalink
Merge schema salad commit '7ea7dcf92e5782c4aca844f1e98d2d9550e07aae' …
Browse files Browse the repository at this point in the history
…into v1.0-errata
  • Loading branch information
Peter Amstutz committed Jul 20, 2017
2 parents 4e24494 + 7ea7dcf commit cc78562
Show file tree
Hide file tree
Showing 134 changed files with 5,333 additions and 2,661 deletions.
8 changes: 8 additions & 0 deletions v1.0/salad/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@
.eggs
*.egg-info/
*pyc

build/
dist/
ruamel
typeshed/2and3/ruamel/yaml
# virtualenv
venv/
.cache/
22 changes: 9 additions & 13 deletions v1.0/salad/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
sudo: false
language: python
python: 2.7
python:
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
os:
- linux
env:
- TOX_ENV=py27-lint
- TOX_ENV=py27-unit
- TOX_ENV=py34-mypy
# - TOX_ENV=py34-lint
# - TOX_ENV=py33-lint
# - TOX_ENV=py34-unit
# - TOX_ENV=py33-unit

install:
- pip install tox

script: tox -e $TOX_ENV

- pip install tox-travis
script: tox
notifications:
email: false
9 changes: 8 additions & 1 deletion v1.0/salad/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
include gittaggers.py ez_setup.py
include gittaggers.py Makefile
include schema_salad/tests/*
include schema_salad/tests/test_schema/*.md
include schema_salad/tests/test_schema/*.yml
include schema_salad/tests/test_schema/*.cwl
include schema_salad/metaschema/*
global-exclude *~
global-exclude *.pyc
58 changes: 35 additions & 23 deletions v1.0/salad/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ MODULE=schema_salad
# `SHELL=bash` Will break Titus's laptop, so don't use BASH-isms like
# `[[` conditional expressions.
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 pytest flake8
COVBASE=coverage run --branch --append --source=${MODULE} \
--omit=schema_salad/tests/*

VERSION=$(shell git describe --tags --dirty | sed s/v//)

Expand All @@ -46,7 +48,7 @@ install-dependencies:

## install : install the ${MODULE} module and schema-salad-tool
install: FORCE
./setup.py build install
pip install .

## dist : create a module package for distribution
dist: dist/${MODULE}-$(VERSION).tar.gz
Expand Down Expand Up @@ -103,37 +105,31 @@ diff_pylint_report: pylint_report.txt
diff-quality --violations=pylint pylint_report.txt

.coverage: $(PYSOURCES)
coverage run --branch --source=${MODULE} setup.py test
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
rm -f .coverage
$(COVBASE) setup.py test
$(COVBASE) -m schema_salad.main \
--print-jsonld-context schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-rdfs schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-avro schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-rdf schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-pre schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-index schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.main \
$(COVBASE) -m schema_salad.main \
--print-metadata schema_salad/metaschema/metaschema.yml \
> /dev/null
coverage run --append --branch --source=${MODULE} \
-m schema_salad.makedoc schema_salad/metaschema/metaschema.yml \
$(COVBASE) -m schema_salad.makedoc \
schema_salad/metaschema/metaschema.yml \
> /dev/null

coverage.xml: .coverage
Expand Down Expand Up @@ -169,17 +165,33 @@ list-author-emails:
@echo 'name, E-Mail Address'
@git log --format='%aN,%aE' | sort -u | grep -v 'root'

mypy: ${PYSOURCES}
MYPYPATH=typeshed/2.7 mypy --py2 --disallow-untyped-calls schema_salad
mypy2: ${PYSOURCES}
rm -Rf typeshed/2and3/ruamel/yaml
ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
typeshed/2and3/ruamel/
MYPYPATH=$MYPYPATH:typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
--warn-redundant-casts \
schema_salad

mypy3: ${PYSOURCES}
rm -Rf typeshed/2and3/ruamel/yaml
ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))') \
typeshed/2and3/ruamel/
MYPYPATH=$MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
--warn-redundant-casts \
schema_salad

jenkins:
if ! test -d env ; then virtualenv env ; fi
rm -Rf env && virtualenv env
. env/bin/activate ; \
pip install -U setuptools pip wheel ; \
${MAKE} install-dep coverage.html coverage.xml pep257_report.txt \
sloccount.sc pep8_report.txt pylint_report.txt
if ! test -d env3 ; then virtualenv -p python3 env3 ; fi
. env3/bin/activate ; \
pip install -U mypy-lang; ${MAKE} mypy
pip install -U setuptools pip wheel ; \
${MAKE} install-dep ; \
pip install -U -r mypy_requirements.txt ; ${MAKE} mypy2
# pip install -U -r mypy_requirements.txt ; ${MAKE} mypy3

FORCE:
7 changes: 7 additions & 0 deletions v1.0/salad/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ Usage
$ python
>>> import schema_salad

To install from source::

git clone https://github.com/common-workflow-language/schema_salad
cd schema_salad
python setup.py install

Documentation
-------------

Expand Down
2 changes: 2 additions & 0 deletions v1.0/salad/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[mypy-ruamel.*]
ignore_errors = True
1 change: 1 addition & 0 deletions v1.0/salad/mypy_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy==0.511 ; python_version>="3"
69 changes: 69 additions & 0 deletions v1.0/salad/release-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/bash

set -e
set -x

package=schema-salad
module=schema_salad
repo=https://github.com/common-workflow-language/schema_salad.git
run_tests="py.test --pyarg ${module}"
pipver=8.0.1 # minimum required version of pip
setupver=20.10.1 # minimum required version of setuptools

rm -Rf testenv? || /bin/true

export HEAD=`git rev-parse HEAD`
virtualenv testenv1
virtualenv testenv2
virtualenv testenv3
virtualenv testenv4

# First we test the head
source testenv1/bin/activate
rm testenv1/lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
make install-dependencies
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir testenv1/not-${module}
# if there is a subdir named '${module}' py.test will execute tests
# there instead of the installed module's tests
pushd testenv1/not-${module}; ../bin/${run_tests}; popd


# Secondly we test via pip

cd testenv2
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
pip install -e git+${repo}@${HEAD}#egg=${package}
cd src/${package}
make install-dependencies
make dist
make test
cp dist/${package}*tar.gz ../../../testenv3/
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
cd ../.. # no subdir named ${proj} here, safe for py.testing the installed module
bin/${run_tests}

# Is the distribution in testenv2 complete enough to build another
# functional distribution?

cd ../testenv3/
source bin/activate
rm lib/python-wheels/setuptools* \
&& pip install --force-reinstall -U pip==${pipver} \
&& pip install setuptools==${setupver} wheel
pip install ${package}*tar.gz
pip install pytest
mkdir out
tar --extract --directory=out -z -f ${package}*.tar.gz
cd out/${package}*
make dist
make test
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
mkdir ../not-${module}
pushd ../not-${module} ; ../../bin/${run_tests}; popd
19 changes: 10 additions & 9 deletions v1.0/salad/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
requests
ruamel.yaml
rdflib >= 4.1.
rdflib-jsonld >= 0.3.0
mistune
typing ; python_version>="2.7"
avro ; python_version<"3"
avro-python3 ; python_version>="3"

typing==3.5.3
avro-cwl ; python_version>="3"
future ; python_version>="3"
avro==1.8.1 ; python_version<"3"
ruamel.yaml>=0.12.4, <0.15
rdflib==4.2.2
rdflib-jsonld==0.4.0
mistune==0.7.3
CacheControl==0.11.7
lockfile==0.12.2
1 change: 1 addition & 0 deletions v1.0/salad/schema_salad/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import absolute_import
import logging
import sys
import typing
Expand Down
1 change: 1 addition & 0 deletions v1.0/salad/schema_salad/__main__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import absolute_import
from . import main
import sys
import typing
Expand Down
7 changes: 0 additions & 7 deletions v1.0/salad/schema_salad/add_dictlist.py

This file was deleted.

10 changes: 0 additions & 10 deletions v1.0/salad/schema_salad/aslist.py

This file was deleted.

Loading

0 comments on commit cc78562

Please sign in to comment.