diff --git a/.github/workflows/readthedocs-preview.yml b/.github/workflows/readthedocs-preview.yml index caa0b894..04ef1b73 100644 --- a/.github/workflows/readthedocs-preview.yml +++ b/.github/workflows/readthedocs-preview.yml @@ -7,7 +7,7 @@ jobs: steps: - uses: readthedocs/actions/preview@v1 with: - project-slug: serious-scaffold-python + project-slug: ss-python name: Read the Docs Pull Request Preview on: pull_request_target: diff --git a/Makefile b/Makefile index f8f11a4f..9eafea00 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ CONSTRAINTS_FILE := constraints/$(PYTHON_VERSION).txt PUBLIC_DIR := $(shell [ "$$READTHEDOCS" = "True" ] && echo "$$READTHEDOCS_OUTPUT/html" || echo "public") # URL and Path of changelog source code. -CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://serious-scaffold.github.io/serious-scaffold-python}/_sources/changelog.md.txt) +CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://serious-scaffold.github.io/ss-python}/_sources/changelog.md.txt) CHANGELOG_PATH := docs/changelog.md ######################################################################################## diff --git a/README.md b/README.md index 1348af65..fe266c81 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ A Python project template covering the entire development lifecycle with various integrations, configurations and modules. -[![CI](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/ci.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/ci.yml) -[![Release](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/release.yml/badge.svg)](https://github.com/serious-scaffold/serious-scaffold-python/actions/workflows/release.yml) -[![Coverage](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/coverage.json)](https://serious-scaffold.github.io/serious-scaffold-python/reports/coverage) -[![PyPI](https://img.shields.io/pypi/v/serious-scaffold)](https://pypi.org/project/serious-scaffold/) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/serious-scaffold)](https://pypi.org/project/serious-scaffold/) -[![GitHub](https://img.shields.io/github/license/serious-scaffold/serious-scaffold-python)](https://github.com/serious-scaffold/serious-scaffold-python/blob/main/LICENSE) +[![CI](https://github.com/serious-scaffold/ss-python/actions/workflows/ci.yml/badge.svg)](https://github.com/serious-scaffold/ss-python/actions/workflows/ci.yml) +[![Release](https://github.com/serious-scaffold/ss-python/actions/workflows/release.yml/badge.svg)](https://github.com/serious-scaffold/ss-python/actions/workflows/release.yml) +[![Coverage](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/coverage.json)](https://serious-scaffold.github.io/ss-python/reports/coverage) +[![PyPI](https://img.shields.io/pypi/v/ss-python)](https://pypi.org/project/ss-python/) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ss-python)](https://pypi.org/project/ss-python/) +[![GitHub](https://img.shields.io/github/license/serious-scaffold/ss-python)](https://github.com/serious-scaffold/ss-python/blob/main/LICENSE) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) @@ -15,16 +15,16 @@ A Python project template covering the entire development lifecycle with various [![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Pydantic v2](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/pydantic/pydantic/5697b1e4c4a9790ece607654e6c02a160620c7e1/docs/badge/v2.json)](https://pydantic.dev) -[![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json)](https://serious-scaffold.github.io/serious-scaffold-python) +[![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json)](https://serious-scaffold.github.io/ss-python) > [!WARNING] > _Serious Scaffold Python_ is in the **Alpha** phase. > Frequent changes and instability should be anticipated. > Any feedback, comments, suggestions and contributions are welcome! -[![Serious Scaffold Python](https://serious-scaffold.github.io/serious-scaffold-python/_static/images/logo.svg)](https://github.com/serious-scaffold/serious-scaffold-python) +[![Serious Scaffold Python](https://serious-scaffold.github.io/ss-python/_static/images/logo.svg)](https://github.com/serious-scaffold/ss-python) -Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template. +Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/ss-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template. If you find this helpful, please consider [sponsorship](https://github.com/sponsors/huxuan). @@ -63,7 +63,7 @@ pipx install pre-commit 1. Generate the project. ```bash - copier copy gh:serious-scaffold/serious-scaffold-python /path/to/project + copier copy gh:serious-scaffold/ss-python /path/to/project ``` 2. Navigate to the project directory and initialize a git repository. @@ -83,7 +83,7 @@ pipx install pre-commit ```bash git add . - git commit -m "Initialize from serious-scaffold-python." + git commit -m "Initialize from serious-scaffold." ``` 5. That's it! Feel free to focus on the coding within `src` folder. @@ -93,18 +93,18 @@ pipx install pre-commit Badge for markdown: ```markdown -[![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json)](https://serious-scaffold.github.io/serious-scaffold-python) +[![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json)](https://serious-scaffold.github.io/ss-python) ``` Badge for restructuredtext: ```restructuredtext -.. image:: https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json - :target: serious-scaffold.github.io/serious-scaffold-python +.. image:: https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json + :target: serious-scaffold.github.io/ss-python ``` -It will look like this: [![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json)](https://serious-scaffold.github.io/serious-scaffold-python) +It will look like this: [![Serious Scaffold Python](https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json)](https://serious-scaffold.github.io/ss-python) ## 📜 License -MIT License, for more details, see the [LICENSE](https://github.com/serious-scaffold/serious-scaffold-python/blob/main/LICENSE) file. +MIT License, for more details, see the [LICENSE](https://github.com/serious-scaffold/ss-python/blob/main/LICENSE) file. diff --git a/copier.yaml b/copier.yaml index 17072734..815812f4 100644 --- a/copier.yaml +++ b/copier.yaml @@ -100,11 +100,21 @@ repo_namespace: help: 'Indicate the GitHub Repository Owner or GitLab Namespace. This is typically the account name of the author or the organization:' type: str repo_name: - default: '{{ project_name|lower|replace(" ", "-") }}' + default: |- + [% if project_name == 'Serious Scaffold Python' -%] + ss-python + [%- else -%] + {{ project_name|lower|replace(" ", "-") }} + [%- endif %] help: 'Provide a name for the repository:' type: str package_name: - default: '{{ repo_name|regex_replace("-python$", "") }}' + default: |- + [% if project_name == 'Serious Scaffold Python' -%] + {{ repo_name }} + [%- else -%] + {{ repo_name|regex_replace("-python$", "") }} + [%- endif %] help: 'Specify the name of the distributable package for the project (often used in "pip install "):' type: str module_name: diff --git a/docs/api/settings.md b/docs/api/settings.md index 357b98a0..203dc6eb 100644 --- a/docs/api/settings.md +++ b/docs/api/settings.md @@ -1,5 +1,5 @@ -# serious_scaffold.settings +# ss_python.settings ```{eval-rst} -.. automodule:: serious_scaffold.settings +.. automodule:: ss_python.settings ``` diff --git a/docs/cli/index.md b/docs/cli/index.md index a157a751..7398dd03 100644 --- a/docs/cli/index.md +++ b/docs/cli/index.md @@ -1,7 +1,7 @@ # CLI Reference ```{eval-rst} -.. click:: serious_scaffold.cli:typer_click_object - :prog: serious-scaffold-cli +.. click:: ss_python.cli:typer_click_object + :prog: ss-python-cli :nested: full ``` diff --git a/docs/conf.py b/docs/conf.py index 6ee988aa..f1ddfd48 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,7 @@ author = "huxuan" copyright = "2023, huxuan" # noqa: A001 project = "Serious Scaffold Python" -release = metadata.version("serious-scaffold") +release = metadata.version("ss-python") version = ".".join(release.split(".")[:2]) diff --git a/docs/dev/proj.md b/docs/dev/proj.md index 32d06b83..dcef67dd 100644 --- a/docs/dev/proj.md +++ b/docs/dev/proj.md @@ -2,7 +2,7 @@ ## Prerequisites -[`copier`](https://copier.readthedocs.io/) serves as a key tool in `serious-scaffold-python`, differentiating it from other project templates. The installation can be done with the following command. +[`copier`](https://copier.readthedocs.io/) serves as a key tool in `serious-scaffold`, differentiating it from other project templates. The installation can be done with the following command. ```{note} Using `pipx` for management is recommended and you can find pipx's installation instructions [here](https://pypa.github.io/pipx/installation/). @@ -33,7 +33,7 @@ pipx install copier ``` ```bash - copier copy gh:serious-scaffold/serious-scaffold-python . + copier copy gh:serious-scaffold/ss-python . ``` 1. Set up the development environment. @@ -46,7 +46,7 @@ pipx install copier ```bash git add . - git commit -m "chore: Initialize from serious-scaffold-python." + git commit -m "chore: Initialize from ss-python." SKIP=no-commit-to-branch git push ``` diff --git a/includes/variable.jinja b/includes/variable.jinja index 8df81003..12244933 100644 --- a/includes/variable.jinja +++ b/includes/variable.jinja @@ -23,11 +23,11 @@ [%- endmacro %] [% macro logo_badge() -%] - [![Serious Scaffold Python]({{ logo_badge_url() }})](https://serious-scaffold.github.io/serious-scaffold-python) + [![Serious Scaffold Python]({{ logo_badge_url() }})](https://serious-scaffold.github.io/ss-python) [%- endmacro %] [% macro logo_badge_url() -%] - https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/serious-scaffold-python/_static/badges/logo.json + https://img.shields.io/endpoint?url=https://serious-scaffold.github.io/ss-python/_static/badges/logo.json [%- endmacro %] [% macro page_url() -%] diff --git a/pyproject.toml b/pyproject.toml index f670f01b..c86ccd7c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,16 +31,16 @@ keywords = [ "project-template", "serious-scaffold", ] -name = "serious-scaffold" +name = "ss-python" readme = "README.md" requires-python = ">=3.8" [project.scripts] -serious-scaffold-cli = "serious_scaffold.cli:app" +ss-python-cli = "ss_python.cli:app" [project.urls] -homepage = "https://github.com/serious-scaffold/serious-scaffold-python/" -issue = "https://github.com/serious-scaffold/serious-scaffold-python/issues" +homepage = "https://github.com/serious-scaffold/ss-python/" +issue = "https://github.com/serious-scaffold/ss-python/issues" [tool.black] force-exclude = ''' @@ -54,7 +54,7 @@ fail_under = 100 [tool.coverage.run] source = [ - "serious_scaffold", + "ss_python", ] [tool.isort] diff --git a/src/serious_scaffold/__init__.py b/src/ss_python/__init__.py similarity index 100% rename from src/serious_scaffold/__init__.py rename to src/ss_python/__init__.py diff --git a/src/serious_scaffold/cli.py b/src/ss_python/cli.py similarity index 100% rename from src/serious_scaffold/cli.py rename to src/ss_python/cli.py diff --git a/src/serious_scaffold/settings.py b/src/ss_python/settings.py similarity index 97% rename from src/serious_scaffold/settings.py rename to src/ss_python/settings.py index 5dfb7eff..9cc7eb50 100644 --- a/src/serious_scaffold/settings.py +++ b/src/ss_python/settings.py @@ -24,7 +24,7 @@ class Settings(BaseSettings): """Default logging level for the project.""" model_config = SettingsConfigDict( - env_prefix="SERIOUS_SCAFFOLD_", + env_prefix="SS_PYTHON_", ) diff --git a/template/Makefile.jinja b/template/Makefile.jinja index a1ecabcb..70d42b93 100644 --- a/template/Makefile.jinja +++ b/template/Makefile.jinja @@ -18,7 +18,7 @@ CONSTRAINTS_FILE := constraints/$(PYTHON_VERSION).txt PUBLIC_DIR := $(shell [ "$$READTHEDOCS" = "True" ] && echo "$$READTHEDOCS_OUTPUT/html" || echo "public") # URL and Path of changelog source code. -CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://serious-scaffold.github.io/serious-scaffold-python}/_sources/changelog.md.txt) +CHANGELOG_URL := $(shell echo $${CI_PAGES_URL:-https://{{ page_url() }}}/_sources/changelog.md.txt) CHANGELOG_PATH := docs/changelog.md ######################################################################################## diff --git a/template/README.md.jinja b/template/README.md.jinja index f9e482e5..e58cf8f3 100644 --- a/template/README.md.jinja +++ b/template/README.md.jinja @@ -42,7 +42,7 @@ [![{{ project_name }}](https://{{ page_url() }}/_static/images/logo.svg)](https://{{ repo_url() }}) -Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/serious-scaffold-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template. +Setting up a project often involves more than just establishing a basic project structure. It involves tasks like integrating GitHub Actions or GitLab CI/CD, configuring lint, test and documentation, as well as implementing settings, logging and other frequently used modules. [Serious Scaffold Python](https://github.com/serious-scaffold/ss-python) streamlines this process. Powered by [`copier`](https://copier.readthedocs.io/), bootstrapping a new Python project can be done with a single command. By answering a few questions, the project will be fully configured and ready for development. Furthermore, the project can be updated alongside the advancement of the template. [% if repo_host_type == 'github.com' -%] If you find this helpful, please consider [sponsorship](https://github.com/sponsors/{{ author_name }}). @@ -84,7 +84,7 @@ pipx install pre-commit 1. Generate the project. ```bash - copier copy gh:serious-scaffold/serious-scaffold-python /path/to/project + copier copy gh:serious-scaffold/ss-python /path/to/project ``` 2. Navigate to the project directory and initialize a git repository. @@ -104,7 +104,7 @@ pipx install pre-commit ```bash git add . - git commit -m "Initialize from serious-scaffold-python." + git commit -m "Initialize from serious-scaffold." ``` 5. That's it! Feel free to focus on the coding within `src` folder. diff --git a/template/docs/dev/proj.md b/template/docs/dev/proj.md index 32d06b83..dcef67dd 100644 --- a/template/docs/dev/proj.md +++ b/template/docs/dev/proj.md @@ -2,7 +2,7 @@ ## Prerequisites -[`copier`](https://copier.readthedocs.io/) serves as a key tool in `serious-scaffold-python`, differentiating it from other project templates. The installation can be done with the following command. +[`copier`](https://copier.readthedocs.io/) serves as a key tool in `serious-scaffold`, differentiating it from other project templates. The installation can be done with the following command. ```{note} Using `pipx` for management is recommended and you can find pipx's installation instructions [here](https://pypa.github.io/pipx/installation/). @@ -33,7 +33,7 @@ pipx install copier ``` ```bash - copier copy gh:serious-scaffold/serious-scaffold-python . + copier copy gh:serious-scaffold/ss-python . ``` 1. Set up the development environment. @@ -46,7 +46,7 @@ pipx install copier ```bash git add . - git commit -m "chore: Initialize from serious-scaffold-python." + git commit -m "chore: Initialize from ss-python." SKIP=no-commit-to-branch git push ``` diff --git a/test/cli_test.py b/test/cli_test.py index cbbf318e..0c37a9b9 100644 --- a/test/cli_test.py +++ b/test/cli_test.py @@ -1,7 +1,7 @@ """Test for cli.""" from typer.testing import CliRunner -from serious_scaffold.cli import app +from ss_python.cli import app runner = CliRunner() diff --git a/test/pkg_test.py b/test/pkg_test.py index a09346bb..f58adf24 100644 --- a/test/pkg_test.py +++ b/test/pkg_test.py @@ -1,8 +1,8 @@ """Test for pkg.""" -import serious_scaffold +import ss_python def test_pkg() -> None: """Test for pkg.""" - assert serious_scaffold.__package__ == "serious_scaffold" + assert ss_python.__package__ == "ss_python" diff --git a/test/settings_test.py b/test/settings_test.py index a28ba335..d2be3528 100644 --- a/test/settings_test.py +++ b/test/settings_test.py @@ -1,13 +1,13 @@ """Test for settings.""" import os -from serious_scaffold.settings import global_settings, settings +from ss_python.settings import global_settings, settings def test_settings() -> None: """Test for settings.""" assert settings.logging_level == os.getenv( - "SERIOUS_SCAFFOLD_LOGGING_LEVEL", + "SS_PYTHON_LOGGING_LEVEL", "INFO", ) assert str(global_settings.ci).lower() == os.getenv("CI", "False").lower()