Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -859,8 +859,8 @@ MigrationBackup/
docs/reference/api/*

# Ignore `example` folder, but not its `README.md`
example/*
!example/README.md
gcc_lite/example/*
!gcc_lite/example/example_folder_README.md

# Ignore Sphinx documentation link checking folder
docs/_linkcheck/
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] -

### Added
- created govcookiecutter-lite package which has two entry points "gcc-lite" to create repo, "gcc-example" to build in development example folder
- added bump-my-version to handle versioning

### Fixed

### Changed
- moved example folder into gcc_lite package

### Removed

Expand Down
Empty file added gcc_lite/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository.
In Windows, delete any pre-existing sub-folders in the `example` folder, and run:

```shell
python -m cookiecutter . -o ./example --no-input
python -m cookiecutter . -o ./gcc_lite/example --no-input
```

Unix and Linux users can alternatively use a `make` command:
Expand Down
28 changes: 28 additions & 0 deletions gcc_lite/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from cookiecutter.main import cookiecutter


def run_gcc_lite():
try:
# Run the gcc-lite command
repo_url = (
"https://github.com/best-practice-and-impact/govcookiecutter-lite.git"
)
cookiecutter(
template=repo_url,
)
except Exception as e:
print(f"An error occurred while running gcc-lite: {e}")


def gcc_lite_example():
try:
# Run the gcc-example command
# Alternate: Use the cookiecutter Python API directly
cookiecutter(template=".", output_dir="./gcc_lite/example", no_input=True)
except Exception as e:
print(f"An error occurred while running gcc-example: {e}")


if __name__ == "__main__":
gcc_lite_example()
run_gcc_lite()
74 changes: 72 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "govcookiecutter-lite"
description = "A lightweight python template for HMG"
version = "1.0.0"
authors = [
{"name" = "ASAP"}
]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12"
]
dependencies = [
"cookiecutter"
]

[project.optional-dependencies]
dev = [
"bandit",
"cookiecutter",
"coverage",
"detect-secrets",
"pytest-cookies",
"sphinx_rtd_theme",
"jinja2-time",
"myst-parser",
"pre-commit",
"pytest",
"pytest-mock",
"pytest-xdist",
"python-dotenv",
"Sphinx",
"toml",
"bump-my-version"
]

[tool.setuptools.packages.find]
include = ["gcc_lite*"]

[tool.bumpversion]
current_version = "1.0.0"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"
replace = "{new_version}"
regex = false
ignore_missing_version = false
ignore_missing_files = false
tag = true
sign_tags = false
tag_name = "v{new_version}"
tag_message = "Bump version: {current_version} → {new_version}"
allow_dirty = false
commit = true
message = "Bump version: {current_version} → {new_version}"
moveable_tags = []
commit_args = "--no-verify"
setup_hooks = []
pre_commit_hooks = []
post_commit_hooks = []

[project.scripts]
gcc-lite = "gcc_lite.main:run_gcc_lite"
gcc-example = "gcc_lite.main:gcc_lite_example"


# `coverage` configurations
[tool.coverage.run]
source = [
Expand All @@ -8,8 +80,6 @@ omit = [
"./{{ cookiecutter.project_slug }}/{{ cookiecutter.project_slug }}/run_pipeline.py"
]

[tool.coverage.omit]

[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:"
Expand Down
Loading