Status legend: [ ] pending • [~] in progress • [x] done
- Initial package scaffold (
pyproject.toml,src/, CLIportkeeper) - Core API:
PortRegistry.reserve()/release(),write_env(),update_config_json() - Basic file locking (fcntl/msvcrt/fallback)
- Examples: Python API, CLI, Docker/Compose patterns
- Makefile: build/test/lint/format/publish; simplified publish flow
- README: usage, tests, docker examples, publish workflow
- Improve CLI help and examples in
--helptext - Polish error messages and exit codes for CLI
- Tests: add comprehensive unit tests
-
tests/conftest.pyto setPYTHONPATH=src - Core: preferred/range selection, hold semantics, release correctness
- File ops:
.envmerge, atomic writes and backups,config.jsonupdate - CLI:
reserveJSON output,--write-env,status,gc
-
- Concurrency correctness
- Add tests for concurrent
reserve()calls (threads/processes) - Validate lock contention and fairness
- Add tests for concurrent
- Registry health
- TTL/heartbeat to auto-GC stale entries
-
gcimprovements: configurable policy (pid check, bind check, ttl)
- Multi-port reservations
- API to reserve a set/list of ports atomically (all-or-nothing)
- Release bulk reservations
- UX
- Add
--jsonpretty output toggle in CLI - Add
--registryand--lockCLI flags (override env/def) - Add
--no-backupforupdate_config_json
- Add
- Cross-platform
- Windows CI run for locking fallback
- macOS CI run for file ops reliability
- Docker tooling
- Compose generator: helper script to inject reserved ports into env
-
portkeeper compose upconvenience wrapper (optional)
- Pre-commit & linters
- Add
.pre-commit-config.yamlwith ruff, end-of-file-fixer, trailing-whitespace - Configure
ruff.tomlwith rules and format profile
- Add
- CI/CD (GitHub Actions)
- Lint + Test matrix: py39..py313 on ubuntu-latest, windows-latest, macos-latest
- Build/publish on tag vX.Y.Z to TestPyPI, manual approve to PyPI
- Documentation site (optional)
- mkdocs or pdoc with API reference and guides
- UDP support (investigate use cases; optional feature flag)
- Named reservations (labels, metadata, owners, process pid)
- Reservation lease/renewal model (daemon or library heartbeat)
- JSON-RPC/HTTP control endpoint (run
portkeeperdas a service) - Language bindings (Node/Python interop via CLI or socket protocol)
- Add
requirements-dev.txtfor contributors (pytest, ruff, build, twine) - Add
CODE_OF_CONDUCT.md,CONTRIBUTING.md,SECURITY.md - Add
CHANGELOG.mdand release notes template
- Benchmark large-range scan performance and optimize
- Optional randomization within range to reduce collision bursts
- Telemetry hooks (count reservations, durations) – behind env flag
- Validate input ranges and host strings robustly
- Harden registry file parsing against corruption
- Optional signature of
config.jsonupdates (future)
- Atomic file updates and cross-platform guarantees
- Locking strategies and fallbacks (fcntl/msvcrt/temp-file)
- Docker/Compose patterns (advanced scenarios, multiple ports)
- Integrating with frameworks (Flask, FastAPI, aiohttp)
- Reserve multiple ports for HTTP + HTTPS + WS simultaneously
- Integrate with
uvicorn/gunicornstartup scripts - Advanced Compose with multiple services reserving distinct ports
- Local orchestration scripts for monorepos
- Publish 0.1.0 to PyPI
- Add
scripts/publish.shwith error guidance for duplicate versions - Switch to SPDX license string (Apache-2.0)
- Docker examples: compose/run, prepare scripts
- Makefile: simplified, no forced venv, release targets (bump+build+publish)
Notes
-
Current local version: see
make version(pyprojectversion/__version__). -
If PyPI rejects an upload with "File already exists", run
make bump-patch && make publish. -
zadaniem portkeeper jest przed uruchomieniem aplikacji dopasowanie w zmiennych .env, docker, package.json, itd portow aby byly wolne w trakcie uruchamiania aplikacji
-
uywaj generycznych nazw dla zmiennych, czy to w docker, czy w .env a nie zapisuj hardkodowanych zmiennych typu visual, edmpt, to sa nazwy wlasne, zmien ten kod, aby komendy byly proste i byly wykonywane w tle, przed uruchomieniem uslugi
-
i testowaly dostepnosc portow i aktualizuowaly wszystkie lub wybrane zmienne w docker, .env, package.json, itd
-
w zaleznosci od typu projektu, przed samym uruchomieniem powinny byc sprawdzone wszystkie porty i zapisane bezposrednio w zmiennych w zalaeznsoci od konfiurgruacji projektu