From 90b54a601e2bdc449ee948b71601f091489ae0cc Mon Sep 17 00:00:00 2001 From: Abel Luck Date: Sat, 3 Feb 2024 09:31:33 +0100 Subject: [PATCH] init repo --- .envrc | 2 ++ .flake8 | 4 ++++ .gitignore | 6 ++++++ README.md | 0 pyproject.toml | 15 +++++++++++++++ shell.nix | 33 +++++++++++++++++++++++++++++++++ src/republisher/__init__.py | 0 tests/__init__.py | 0 8 files changed, 60 insertions(+) create mode 100644 .envrc create mode 100644 .flake8 create mode 100644 .gitignore create mode 100644 README.md create mode 100644 pyproject.toml create mode 100644 shell.nix create mode 100644 src/republisher/__init__.py create mode 100644 tests/__init__.py diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..bd5979d --- /dev/null +++ b/.envrc @@ -0,0 +1,2 @@ +use nix +#dotenv diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..1747b8f --- /dev/null +++ b/.flake8 @@ -0,0 +1,4 @@ +[flake8] +min_python_version = 3.10.0 +extend-ignore = E501,E203 +ban-relative-imports = true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4a7d75e --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +__pycache__ +.env +.venv +.vscode +.mypy_cache +.direnv diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..d5650b1 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "republisher" +version = "0.1.0" +description = "" +authors = ["Abel Luck "] +readme = "README.md" +packages = [{include = "republisher", from = "src"}] + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..8a9d2ae --- /dev/null +++ b/shell.nix @@ -0,0 +1,33 @@ +{ system ? "x86_64-linux", pkgs ? import { inherit system; } }: + +let + packages = [ + pkgs.python311 + pkgs.poetry + pkgs.zsh + ]; + + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + pkgs.stdenv.cc.cc + # Add any missing library needed + # You can use the nix-index package to locate them, e.g. nix-locate -w --top-level --at-root /lib/libudev.so.1 + ]; + + # Put the venv on the repo, so direnv can access it + POETRY_VIRTUALENVS_IN_PROJECT = "true"; + POETRY_VIRTUALENVS_PATH = "{project-dir}/.venv"; + + # Use python from path, so you can use a different version to the one bundled with poetry + POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON = "true"; +in + pkgs.mkShell { + buildInputs = packages; + shellHook = '' + export SHELL=${pkgs.zsh} + export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" + export POETRY_VIRTUALENVS_IN_PROJECT="${POETRY_VIRTUALENVS_IN_PROJECT}" + export POETRY_VIRTUALENVS_PATH="${POETRY_VIRTUALENVS_PATH}" + export POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON="${POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON}" + export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring + ''; + } diff --git a/src/republisher/__init__.py b/src/republisher/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29