-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
371 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
.PHONY: clean clean-test clean-pyc clean-build docs help | ||
.DEFAULT_GOAL := help | ||
|
||
define BROWSER_PYSCRIPT | ||
import os, webbrowser, sys | ||
|
||
try: | ||
from urllib import pathname2url | ||
except: | ||
from urllib.request import pathname2url | ||
|
||
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) | ||
endef | ||
export BROWSER_PYSCRIPT | ||
|
||
define PRINT_HELP_PYSCRIPT | ||
import re, sys | ||
|
||
for line in sys.stdin: | ||
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) | ||
if match: | ||
target, help = match.groups() | ||
print("%-20s %s" % (target, help)) | ||
endef | ||
export PRINT_HELP_PYSCRIPT | ||
|
||
BROWSER := python -c "$$BROWSER_PYSCRIPT" | ||
|
||
help: | ||
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) | ||
|
||
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts | ||
|
||
clean-build: ## remove build artifacts | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr .eggs/ | ||
find . -name '*.egg-info' -exec rm -fr {} + | ||
find . -name '*.egg' -exec rm -f {} + | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
clean-test: ## remove test and coverage artifacts | ||
rm -fr .tox/ | ||
rm -f .coverage | ||
rm -fr htmlcov/ | ||
rm -fr .pytest_cache | ||
|
||
lint: ## check style with flake8 | ||
flake8 standard_names tests | ||
|
||
pretty: ## reformat files to make them look pretty | ||
find standard_names -name '*.py' | xargs isort | ||
black setup.py standard_names | ||
|
||
test: ## run tests quickly with the default Python | ||
py.test | ||
|
||
test-all: ## run tests on every Python version with tox | ||
tox | ||
|
||
coverage: ## check code coverage quickly with the default Python | ||
pytest --cov=standard_names --cov-report= --cov-report=html --cov-config=setup.cfg | ||
$(BROWSER) htmlcov/index.html | ||
|
||
docs: ## generate Sphinx HTML documentation, including API docs | ||
rm -f docs/api/standard_names.rst | ||
rm -f docs/api/modules.rst | ||
sphinx-apidoc --force -o docs/api standard_names *tests | ||
$(MAKE) -C docs clean | ||
$(MAKE) -C docs html | ||
$(BROWSER) docs/_build/html/index.html | ||
|
||
changelog: | ||
changelog --force --batch | ||
|
||
servedocs: docs ## compile the docs watching for changes | ||
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . | ||
|
||
release: dist ## package and upload a release | ||
twine upload dist/* | ||
|
||
dist: clean ## builds source and wheel package | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
ls -l dist | ||
|
||
install: clean ## install the package to the active Python's site-packages | ||
python setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,37 @@ | ||
environment: | ||
|
||
global: | ||
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\.ci\\appveyor\\run_with_env.cmd" | ||
ANACONDA_TOKEN: | ||
secure: zCRzslOrbeC7LtC9Z7qHe4PnG3oUhSo5CHI7V9KShfMO/ZGZrWLbk1U7y7HM+09Y | ||
BUILD_STR: "dev" | ||
|
||
matrix: | ||
- PYTHON: "C:\\Python27" | ||
DISTUTILS_USE_SDK: "1" | ||
PYTHON_VERSION: "2.7" | ||
- PYTHON: "C:\\Python35" | ||
PYTHON_VERSION: "3.5" | ||
- TARGET_ARCH: x64 | ||
CONDA_INSTALL_LOCN: C:\\Miniconda37-x64 | ||
CONDA_ENV: py37-windows | ||
|
||
- TARGET_ARCH: x64 | ||
CONDA_INSTALL_LOCN: C:\\Miniconda36-x64 | ||
CONDA_ENV: py36-windows | ||
|
||
platform: | ||
- x64 | ||
- x86 | ||
|
||
os: Previous Visual Studio 2015 | ||
|
||
init: | ||
- "ECHO %PYTHON% %PYTHON_VERSION% %HOME% %PLATFORM%" | ||
- "ECHO %CONDA_INSTALL_LOCN% %CONDA_PY% %HOME% %PLATFORM%" | ||
- "ECHO %APPVEYOR_REPO_BRANCH%" | ||
|
||
install: | ||
- powershell .ci/appveyor/install.ps1 | ||
- if "%APPVEYOR_REPO_TAG%"=="true" if "%APPVEYOR_REPO_TAG_NAME:~0,1%"=="v" set BUILD_STR="" | ||
- IF "%PLATFORM%"=="x64" (SET SUFFIX="_64") ELSE (SET SUFFIX="_32") | ||
- "set PATH=%PYTHON%%SUFFIX%;%PYTHON%%SUFFIX%/Scripts;%PYTHON%%SUFFIX%/Library/bin;%PATH%" | ||
- conda info | ||
- conda config --set always_yes yes | ||
- conda install -q --force --no-deps conda psutil ruamel_yaml requests | ||
- conda install -q python=%PYTHON_VERSION% | ||
- conda install -q conda-build | ||
- conda install -q anaconda-client | ||
- conda install -q pytest | ||
- pip install twine | ||
- "%WITH_COMPILER% conda build -q conda-recipe" | ||
- "%WITH_COMPILER% conda install -q standard_names --use-local" | ||
- "conda list" | ||
build: false | ||
- cmd: call %CONDA_INSTALL_LOCN%\Scripts\activate.bat | ||
- cmd: conda update --yes --quiet conda | ||
- cmd: set PYTHONUNBUFFERED=1 | ||
- cmd: conda config --set always_yes yes | ||
- cmd: conda update conda | ||
- cmd: conda config --append channels conda-forge | ||
- cmd: conda env create -n test_env --file ci/requirements-$CONDA_ENV.yml | ||
- cmd: conda activate test_env | ||
- cmd: python --version | ||
- cmd: pip install . -r requirements.txt | ||
|
||
test_script: | ||
- "%WITH_COMPILER% pytest" | ||
|
||
after_test: | ||
- "%WITH_COMPILER% python setup.py bdist_wheel" | ||
|
||
artifacts: | ||
# Archive the generated conda package in the ci.appveyor.com build report. | ||
- path: 'dist\*' | ||
build: false | ||
|
||
deploy_script: | ||
- "python .ci/appveyor/anaconda_upload.py" | ||
# - "python .ci/appveyor/pypi_upload.py" | ||
test_script: | ||
- pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 | ||
- flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
name: test_env | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- python=3.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
numpydoc | ||
nose | ||
pyyaml | ||
coveralls | ||
pytest>=3.6 | ||
pytest-cov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
"""The CSDMS Standard Names""" | ||
|
||
from .standardname import StandardName, is_valid_name | ||
from .registry import NamesRegistry | ||
from ._version import get_versions | ||
from .error import BadNameError, BadRegistryError | ||
from .registry import NamesRegistry | ||
from .standardname import StandardName, is_valid_name | ||
|
||
__all__ = [ | ||
"StandardName", | ||
"is_valid_name", | ||
"NamesRegistry", | ||
"BadNameError", | ||
"BadRegistryError", | ||
] | ||
|
||
from ._version import get_versions | ||
__version__ = get_versions()['version'] | ||
__version__ = get_versions()["version"] | ||
del get_versions |
Oops, something went wrong.