aboutsummaryrefslogtreecommitdiff
path: root/ci/bootstrap.py
diff options
context:
space:
mode:
authornatsuoto <[email protected]>2026-04-28 17:15:32 +0530
committernatsuoto <[email protected]>2026-04-28 17:15:32 +0530
commitdef2e0846ae01a1415e9acc9f5104963386834eb (patch)
treeb99ea09e19ae7c0464dea1770d635512127f48b8 /ci/bootstrap.py
parentf55b6d06b114a1e1a652ffd5203e31d1b9f41862 (diff)
downloadedify-def2e0846ae01a1415e9acc9f5104963386834eb.tar.xz
edify-def2e0846ae01a1415e9acc9f5104963386834eb.zip
chore: remove dead cookiecutter regeneration infrastructure
The repo was bootstrapped from `cookiecutter-pylibrary`. The regeneration scaffolding has been sitting around since then — unused, out of date, and in some cases pointing at infrastructure (AppVeyor) that hasn't been part of CI for years. Knock it all down in one sweep so there's nothing dead-by-design in the tree after this PR. Removed - `.cookiecutterrc` — cookiecutter regen metadata. - `ci/bootstrap.py` — entry point for regenerating workflow files from the templates. - `ci/templates/` (whole directory): - `.appveyor.yml` template (AppVeyor isn't wired up). - `.github/workflows/github-actions.yml` Jinja template (the live workflow has evolved past it via #32, #35, #37). Coupled updates - `tox.ini`: dropped the `[testenv:bootstrap]` env (calls deleted `bootstrap.py`) and the `bootstrap` reference in the basepython selector. - `MANIFEST.in`: removed `include .cookiecutterrc`. - `setup.cfg`: removed `ci/templates` from the flake8 `exclude` and isort `skip` lists (dead exclusion paths). - `.pre-commit-config.yaml`: removed `ci/templates` from the top-level `exclude` regex. - `tests.local.sh`: replaced the per-version `if/elif` chain (which still listed Python 3.7 and missed 3.12-3.14) with a single programmatic `tox -e py$VERSION` lookup against `tox --listenvs-all`. Self-maintaining when the matrix changes. - `CHANGELOG.rst`: added a Housekeeping bullet for this PR. Live and untouched - `ci/requirements.txt` is still installed by every CI workflow (`pip install -r ci/requirements.txt`). Not regen-related. Closes #46
Diffstat (limited to 'ci/bootstrap.py')
-rwxr-xr-xci/bootstrap.py93
1 files changed, 0 insertions, 93 deletions
diff --git a/ci/bootstrap.py b/ci/bootstrap.py
deleted file mode 100755
index 3ca06b7..0000000
--- a/ci/bootstrap.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-from __future__ import absolute_import
-from __future__ import print_function
-from __future__ import unicode_literals
-
-import os
-import subprocess
-import sys
-from os.path import abspath
-from os.path import dirname
-from os.path import exists
-from os.path import join
-from os.path import relpath
-
-base_path = dirname(dirname(abspath(__file__)))
-templates_path = join(base_path, "ci", "templates")
-
-
-def check_call(args):
- print("+", *args)
- subprocess.check_call(args)
-
-
-def exec_in_env():
- env_path = join(base_path, ".tox", "bootstrap")
- if sys.platform == "win32":
- bin_path = join(env_path, "Scripts")
- else:
- bin_path = join(env_path, "bin")
- if not exists(env_path):
- import subprocess
-
- print("Making bootstrap env in: {0} ...".format(env_path))
- try:
- check_call([sys.executable, "-m", "venv", env_path])
- except subprocess.CalledProcessError:
- try:
- check_call([sys.executable, "-m", "virtualenv", env_path])
- except subprocess.CalledProcessError:
- check_call(["virtualenv", env_path])
- print("Installing `jinja2` into bootstrap environment...")
- check_call([join(bin_path, "pip"), "install", "jinja2", "tox"])
- python_executable = join(bin_path, "python")
- if not os.path.exists(python_executable):
- python_executable += '.exe'
-
- print("Re-executing with: {0}".format(python_executable))
- print("+ exec", python_executable, __file__, "--no-env")
- os.execv(python_executable, [python_executable, __file__, "--no-env"])
-
-
-def main():
- import jinja2
-
- print("Project path: {0}".format(base_path))
-
- jinja = jinja2.Environment(
- loader=jinja2.FileSystemLoader(templates_path),
- trim_blocks=True,
- lstrip_blocks=True,
- keep_trailing_newline=True,
- )
-
- tox_environments = [
- line.strip()
- # 'tox' need not be installed globally, but must be importable
- # by the Python that is running this script.
- # This uses sys.executable the same way that the call in
- # cookiecutter-pylibrary/hooks/post_gen_project.py
- # invokes this bootstrap.py itself.
- for line in subprocess.check_output([sys.executable, '-m', 'tox', '--listenvs'], universal_newlines=True).splitlines()
- ]
- tox_environments = [line for line in tox_environments if line.startswith('py')]
-
- for root, _, files in os.walk(templates_path):
- for name in files:
- relative = relpath(root, templates_path)
- with open(join(base_path, relative, name), "w") as fh:
- fh.write(jinja.get_template(join(relative, name)).render(tox_environments=tox_environments))
- print("Wrote {}".format(name))
- print("DONE.")
-
-
-if __name__ == "__main__":
- args = sys.argv[1:]
- if args == ["--no-env"]:
- main()
- elif not args:
- exec_in_env()
- else:
- print("Unexpected arguments {0}".format(args), file=sys.stderr)
- sys.exit(1)