Skip to content

Commit

Permalink
Added support for dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
clamytoe committed Nov 8, 2023
1 parent 41aa557 commit 8a44b83
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 149 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ If you encounter any problems, please [file an issue](https://github.com/clamyto

## Changelog

* **v0.4.3** Added support for dotenv.
* **v0.4.2** Updated for the year 2023 and python 3.10.12.
* **v0.4.1** Updated for the year 2022.
* **v0.4.0** Removed logging fromt the project, I never really use it on my small scripts and always end up removed it.
Expand Down
10 changes: 8 additions & 2 deletions cookiecutter.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
"email_address": "[email protected]",
"github_account": "clamytoe",
"version": "0.1.0",
"year": "2023",
"year": "{% now 'utc', '%Y' %}",
"python_version": "3.10.12",
"project_name": "toepack_clone",
"project_title": "Clamytoe's Project Template",
"description": "Bare minimum Python project templating system based on Cookiecutter."
"description": "Bare minimum Python project templating system based on Cookiecutter.",
"_copy_without_render": [
".env",
".flake8",
".gitattributes",
".gitignore"
]
}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cookiecutter==1.7.3
cookiecutter>=2.4.0
27 changes: 14 additions & 13 deletions {{cookiecutter.project_name}}/.flake8
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[flake8]
# E226: missing whitespace around arithmetic operator
# E402: module level import not at top of file
ignore = E226,E402
max-line-length = 88
exclude =
.git,
.idea,
.pytest_cache,
.vscode,
*.egg-info,
__pycache__,
max-complexity = 10
[flake8]
# E226: missing whitespace around arithmetic operator
# E402: module level import not at top of file
ignore = E226,E402
max-line-length = 88
exclude =
.env,
.git,
.idea,
.pytest_cache,
.vscode,
*.egg-info,
__pycache__,
max-complexity = 10
223 changes: 113 additions & 110 deletions {{cookiecutter.project_name}}/.gitignore
Original file line number Diff line number Diff line change
@@ -1,110 +1,113 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# PyCharm
.idea/

# pytest
.pytest_cache/

# vscode
.vscode/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

# virtualenv
.venv
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

# PyCharm
.idea/

# pytest
.pytest_cache/

# vscode
.vscode/

# env file
.env
25 changes: 13 additions & 12 deletions {{cookiecutter.project_name}}/environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: {{cookiecutter.project_name}}
channels:
- defaults
- conda-forge
dependencies:
- black
- flake8
- isort
- mypy
- pytest
- pytest-cov
- python={{cookiecutter.python_version}}
name: {{cookiecutter.project_name}}
channels:
- defaults
- conda-forge
dependencies:
- black
- flake8
- isort
- mypy
- pytest
- pytest-cov
- python={{cookiecutter.python_version}}
- python-dotenv
3 changes: 2 additions & 1 deletion {{cookiecutter.project_name}}/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
pytest
pytest
python-dotenv
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
"""
test_{{cookiecutter.project_name}}.py
Tests for {{cookiecutter.project_name}}.
"""
from {{cookiecutter.project_name}} import __version__


def test_version():
assert __version__ == '{{cookiecutter.version}}'
"""
test_{{cookiecutter.project_name}}.py
Tests for {{cookiecutter.project_name}}.
"""
from os import environ
from dotenv import load_dotenv
from {{cookiecutter.project_name}} import __version__


def test_version():
assert __version__ == '{{cookiecutter.version}}'


def test_env():
load_dotenv()
assert environ.get("TEST_VALUE") == "clamytoe"

0 comments on commit 8a44b83

Please sign in to comment.