init
This commit is contained in:
commit
4b3754041c
4
.env.example
Normal file
4
.env.example
Normal file
@ -0,0 +1,4 @@
|
||||
GITEA_URL=https://git.chipperfluff.at/Hyperpyemia/NotEnoughDecorators.git
|
||||
GITEA_OWNER=Hyperpyemia
|
||||
GITEA_USERNAME=your-username
|
||||
GITEA_TOKEN=replace-with-a-gitea-access-token
|
||||
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
.env
|
||||
.venv/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*.egg-info/
|
||||
.pytest_cache/
|
||||
.ruff_cache/
|
||||
build/
|
||||
dist/
|
||||
|
||||
53
Makefile
Normal file
53
Makefile
Normal file
@ -0,0 +1,53 @@
|
||||
SHELL := /bin/bash
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
PYTHON ?= python3
|
||||
VENV ?= .venv
|
||||
VENV_BIN := $(VENV)/bin
|
||||
|
||||
.PHONY: help venv install test lint format build check-publish-config publish clean
|
||||
|
||||
help: ## Show the available commands
|
||||
@awk 'BEGIN {FS = ":.*## "; printf "Usage: make <target>\n\n"} /^[a-zA-Z_-]+:.*?## / {printf " %-22s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
venv: ## Create a local virtual environment
|
||||
$(PYTHON) -m venv $(VENV)
|
||||
|
||||
install: venv ## Install the package and development tools
|
||||
$(VENV_BIN)/python -m pip install --upgrade pip
|
||||
$(VENV_BIN)/python -m pip install -e '.[dev]'
|
||||
|
||||
test: ## Run the test suite
|
||||
$(VENV_BIN)/pytest
|
||||
|
||||
lint: ## Check formatting and lint the code
|
||||
$(VENV_BIN)/ruff check .
|
||||
$(VENV_BIN)/ruff format --check .
|
||||
|
||||
format: ## Format the Python code
|
||||
$(VENV_BIN)/ruff check --fix .
|
||||
$(VENV_BIN)/ruff format .
|
||||
|
||||
build: ## Build wheel and source distributions
|
||||
rm -rf build dist
|
||||
$(VENV_BIN)/python -m build
|
||||
|
||||
check-publish-config: ## Validate the Gitea package registry settings
|
||||
@set -a; source .env 2>/dev/null || { echo "Missing .env (copy .env.example to .env)"; exit 1; }; set +a; \
|
||||
for variable in GITEA_URL GITEA_OWNER GITEA_USERNAME GITEA_TOKEN; do \
|
||||
if [[ -z "$${!variable}" ]]; then echo "Missing $$variable in .env"; exit 1; fi; \
|
||||
done
|
||||
|
||||
publish: check-publish-config build ## Upload the package to the Gitea PyPI registry
|
||||
@set -a; source .env; set +a; \
|
||||
TWINE_USERNAME="$$GITEA_USERNAME" \
|
||||
TWINE_PASSWORD="$$GITEA_TOKEN" \
|
||||
$(VENV_BIN)/python -m twine upload \
|
||||
--repository-url "$${GITEA_URL%/}/api/packages/$$GITEA_OWNER/pypi" \
|
||||
dist/*
|
||||
|
||||
clean: ## Remove generated files
|
||||
rm -rf .pytest_cache .ruff_cache build dist *.egg-info src/*.egg-info
|
||||
find . -type d -name __pycache__ -prune -exec rm -rf {} +
|
||||
find . -type f -name '*.py[co]' -delete
|
||||
|
||||
5
README.md
Normal file
5
README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# NED
|
||||
|
||||
meow
|
||||
|
||||
<sub style="color: grey;"><small><small>Used bootstrap v1.0.0</small></small></sub>
|
||||
33
pyproject.toml
Normal file
33
pyproject.toml
Normal file
@ -0,0 +1,33 @@
|
||||
[build-system]
|
||||
requires = ["hatchling>=1.25"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "NED"
|
||||
version = "0.0.1"
|
||||
description = "meow"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
license = { text = "MIT" }
|
||||
authors = [
|
||||
{ name = "Chipperfluff", email = "contact@chipi.at" },
|
||||
]
|
||||
dependencies = []
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = [
|
||||
"build>=1.2",
|
||||
"pytest>=8.0",
|
||||
"ruff>=0.5",
|
||||
"twine>=5.1",
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/ned"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
target-version = "py310"
|
||||
3
src/ned/__init__.py
Normal file
3
src/ned/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
def hello(name: str = "world") -> str:
|
||||
"""Return a friendly greeting."""
|
||||
return f"Hello, {name}!"
|
||||
5
tests/test_core.py
Normal file
5
tests/test_core.py
Normal file
@ -0,0 +1,5 @@
|
||||
from ned import hello
|
||||
|
||||
|
||||
def test_hello() -> None:
|
||||
assert hello("Gitea") == "Hello, Gitea!"
|
||||
Loading…
x
Reference in New Issue
Block a user