-
Notifications
You must be signed in to change notification settings - Fork 0
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
11 changed files
with
143 additions
and
98 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 |
---|---|---|
@@ -1,9 +1,11 @@ | ||
*.pyc | ||
.tox/ | ||
/.tox | ||
.coverage | ||
__pycache__ | ||
castaway.egg-info/ | ||
venv/ | ||
htmlcov/ | ||
temp/ | ||
/src/castaway.egg-info | ||
/venv | ||
/htmlcov | ||
/temp | ||
/dist | ||
/.pytest_cache | ||
.python-version |
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,46 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "castaway" | ||
version = "1.1.0" | ||
description = "Simple wrapper for dotenv, with casting" | ||
requires-python = ">=3.10" | ||
readme = { file = "README.rst", content-type = "text/x-rst" } | ||
license = { file = "LICENSE" } | ||
authors = [ | ||
{ name = "David Krauth", email = "dakrauth@gmail.com"}, | ||
] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Environment :: Web Environment", | ||
"Environment :: Console", | ||
"Framework :: Django", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
] | ||
dependencies = ["python-dotenv[cli]==1.0.1"] | ||
|
||
[project.urls] | ||
Homepage = "http://github.com/dakrauth/castaway" | ||
|
||
[project.optional-dependencies] | ||
django = [ "dj-email-url==1.0.6", "dj-database-url==2.3.0" ] | ||
test = ["pytest-cov", "tox"] | ||
|
||
[tool.setuptools] | ||
package-dir = { "" = "src" } | ||
packages = [ "castaway" ] | ||
|
||
[tool.ruff] | ||
line-length = 100 | ||
indent-width = 4 | ||
|
||
[tool.ruff.lint] | ||
ignore = ["E741"] |
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,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit | ||
set -o pipefail | ||
TIMEFORMAT="Task completed in %3lR" | ||
BIN="./venv/bin" | ||
|
||
function help { | ||
echo "Options:" | ||
echo " init: Setup dev environment" | ||
echo " lint: Linter" | ||
echo " check: Formatting checks" | ||
echo " format: Run formatter" | ||
echo " test: Execute tests" | ||
echo " coverage: Run tests with code coverage" | ||
echo " clean: Remove dev, test, and build artifacts" | ||
} | ||
|
||
function init { | ||
python3 -m venv --prompt castaway venv | ||
"${BIN}/python" -m pip install -e ".[django,test]" | ||
} | ||
|
||
function lint { | ||
"${BIN}/ruff" check castaway.py tests | ||
} | ||
|
||
function check { | ||
"${BIN}/ruff" format --check --diff src/castaway tests | ||
} | ||
|
||
function format { | ||
"${BIN}/ruff" format src/castaway tests | ||
} | ||
|
||
function test { | ||
"${BIN}/pytest" -s -Werror tests "$@" | ||
} | ||
|
||
function clean { | ||
rm -rf .ruff_cache .tox htmlcov .coverage dist pytest_cache src/castaway.egg-info | ||
} | ||
|
||
function coverage { | ||
"${BIN}/pytest" \ | ||
--cov-report html \ | ||
--cov-report term \ | ||
--cov=castaway | ||
} | ||
|
||
if [ -z "$1" ]; then | ||
help | ||
else | ||
what=$1 | ||
shift | ||
time ${what:-help} "$@" | ||
fi |
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 @@ | ||
CASTAWAY_DECIMAL=3.14159 |
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