Skip to content

Commit

Permalink
template files
Browse files Browse the repository at this point in the history
  • Loading branch information
jarq6c committed Jul 22, 2021
1 parent d4c276d commit dbf986f
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 0 deletions.
7 changes: 7 additions & 0 deletions EXCLUDE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
*__pycache__*
*.py[cod]
*$py.class
miniconda3/*
sha256sum.txt
Miniconda3-py*
*.pytest_cache*
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include LICENSE
29 changes: 29 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
REPOSITORY=https://repo.anaconda.com/miniconda
INSTALLER=Miniconda3-py38_4.9.2-Linux-x86_64.sh
HASH=1314b90489f154602fd794accfc90446111514a5a72fe1f71ab83e07de9504a7
HASHFILE=sha256sum.txt
PYENV=miniconda3
PYTHON=$(PYENV)/bin/python3

.PHONY: build checksum clean

build: $(PYENV)/bin/activate
$(PYTHON) -m build

$(PYENV)/bin/activate: checksum requirements.txt
test -d $(PYENV) || bash ./$(INSTALLER) -b -p $(PYENV)
$(PYTHON) -m pip install -U pip wheel setuptools build pytest
$(PYTHON) -m pip install -r requirements.txt
touch $(PYENV)/bin/activate

checksum: $(INSTALLER) $(HASHFILE)
sha256sum -c $(HASHFILE)

$(INSTALLER):
wget $(REPOSITORY)/$(INSTALLER)

$(HASHFILE):
echo "$(HASH) $(INSTALLER)" > $(HASHFILE)

clean:
rm -rf dist/ $(PYENV) $(HASHFILE) $(INSTALLER)
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-s"
testpaths = [
"tests",
]
31 changes: 31 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
attrs==21.2.0
brotlipy==0.7.0
build==0.5.1
certifi==2020.6.20
cffi==1.14.3
chardet==3.0.4
conda==4.9.2
conda-package-handling==1.7.2
cryptography==3.2.1
evaluation-tools==1.2.0
idna==2.10
iniconfig==1.1.1
packaging==21.0
pep517==0.10.0
pip==21.1.3
pluggy==0.13.1
py==1.10.0
pycosat==0.6.3
pycparser==2.20
pyOpenSSL==19.1.0
pyparsing==2.4.7
PySocks==1.7.1
pytest==6.2.4
requests==2.24.0
ruamel-yaml==0.15.87
setuptools==57.2.0
six==1.15.0
toml==0.10.2
tqdm==4.51.0
urllib3==1.25.11
wheel==0.36.2
37 changes: 37 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[metadata]
name = hello
version = 0.1.0
author = Your Name
author_email = [email protected]
description = Generic template for data-driven projects using Python.
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
license = USDOC
license_files =
LICENSE
url = https://github.com/NOAA-OWP/
project_urls =
Documentation = https://github.com/NOAA-OWP/
Source = https://github.com/NOAA-OWP/
Tracker = https://github.com/NOAA-OWP/
classifiers =
Development Status :: 1 - Planning
Intended Audience :: Education
Intended Audience :: Science/Research
License :: Free To Use But Restricted
Programming Language :: Python :: 3.8
Topic :: Scientific/Engineering :: Hydrology
Operating System :: OS Independent
Private :: Do not Upload

[options]
packages = find:
package_dir =
=src
install_requires =
numpy
python_requires = >=3.8
include_package_data = True

[options.packages.find]
where = src
Empty file added src/hello/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions src/hello/hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def greet(name: str):
"""
Create a simple greeting.
Parameters
----------
name: str, required
Name of person to greet.
Returns
-------
greeting: str
String with a simple greeting.
"""
# Return greeting
return f"Hello, {name}!"
9 changes: 9 additions & 0 deletions tests/test_hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import pytest
from hello.hello import greet

def test_greet():
# Create a greeting
greeting = greet("Jo")

# Check the greeting
assert greeting == "Hello, Jo!"

0 comments on commit dbf986f

Please sign in to comment.