From 4de8a724fb170bf4c9d86825fdba19524acf609f Mon Sep 17 00:00:00 2001 From: Josh Thomas Date: Fri, 27 Oct 2023 16:38:52 -0500 Subject: [PATCH] do some cleanup before initial release (#100) * do some cleanup before initial release * remove `psycopg2` optional dep --- Justfile | 49 ++----------------------------------------------- RELEASING.md | 6 ++++-- pyproject.toml | 6 ++---- 3 files changed, 8 insertions(+), 53 deletions(-) diff --git a/Justfile b/Justfile index 73f842c..fd8e308 100644 --- a/Justfile +++ b/Justfile @@ -7,18 +7,15 @@ set dotenv-load := true # DEPENDENCIES # ################## -@bootstrap: +bootstrap: python -m pip install --editable '.[dev,hc,relay]' -install: - python -m pip install --editable '.[dev]' - pup: python -m pip install --upgrade pip update: @just pup - @just install + @just bootstrap venv PY_VERSION="3.11.5": #!/usr/bin/env python @@ -95,27 +92,6 @@ createsuperuser USERNAME="admin" EMAIL="" PASSWORD="admin": # DOCKER # ################## -enter CONTAINER="relay[-_]devcontainer[-_]app" SHELL="zsh" WORKDIR="/workspace" USER="vscode": - #!/usr/bin/env sh - if [ -f "/.dockerenv" ]; then - echo "command cannot be run from within a Docker container" - else - case {{ SHELL }} in - "zsh" ) - shell_path="/usr/bin/zsh" ;; - "bash" ) - shell_path="/bin/bash" ;; - "sh" ) - shell_path="/bin/sh" ;; - * ) - shell_path="/usr/bin/zsh" ;; - esac - - container=$(docker ps --filter "name={{ CONTAINER }}" --format "{{{{.Names}}") - - docker exec -it -u {{ USER }} -w {{ WORKDIR }} $container $shell_path - fi - testbuild: docker build -t relay:latest -f .dockerfiles/Dockerfile . @@ -242,27 +218,6 @@ createdb CONTAINER_NAME="relay_postgres" VERSION="15.3": @docs-build LOCATION="docs/_build/html": sphinx-build docs {{ LOCATION }} -################## -# ENV SYNC # -################## - -envsync: - #!/usr/bin/env python - from pathlib import Path - - envfile = Path('.env') - envfile_example = Path('.env.example') - - if not envfile.exists(): - envfile.write_text(envfile_example.read_text()) - - with envfile.open() as f: - lines = [line for line in f.readlines() if not line.endswith('# envsync: ignore\n')] - lines = [line.split('=')[0] + '=\n' if line.endswith('# envsync: no-value\n') else line for line in lines] - - lines.sort() - envfile_example.write_text(''.join(lines)) - ################## # UTILS # ################## diff --git a/RELEASING.md b/RELEASING.md index 2937556..28b7898 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -16,10 +16,12 @@ When it comes time to cut a new release, follow these steps: The `pyproject.toml` in the base of the repository contains a `[tool.bumpver]` section that configures the `bumpver` tool to update the version number wherever it needs to be updated and to create a commit with the appropriate commit message. - If you have not already installed `bumpver`, you can install it with: + `bumpver` is included as a development dependency, so you should already have it installed if you have installed the development dependencies for this project. If you do not have the development dependencies installed, you can install them with either of the following commands: ```shell - python -m pip install bumpver + python -m pip install --editable '.[dev]' + # or using the included `Justfile` + just bootstrap ``` Then, run `bumpver` to update the version number, with the appropriate command line arguments. See the [`bumpver` documentation](https://github.com/mbarkhau/bumpver) for more details. diff --git a/pyproject.toml b/pyproject.toml index 380e4d9..8881094 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,6 @@ classifiers = [ "Framework :: Django :: 3", "Framework :: Django :: 3.2", "Framework :: Django :: 4", - "Framework :: Django :: 4.0", "Framework :: Django :: 4.1", "Framework :: Django :: 4.2", "License :: OSI Approved :: MIT License", @@ -38,8 +37,8 @@ requires-python = ">=3.8" [project.optional-dependencies] dev = [ + "bumpver", "coverage[toml]", - "django-email-relay[hc,relay]", "django-stubs", "django-stubs-ext", "faker", @@ -68,11 +67,10 @@ docs = [ hc = ["requests"] lint = ["pre-commit"] psycopg = ["psycopg[binary]"] -psycopg2 = ["psycopg2-binary"] relay = ["environs[django]"] [project.urls] -Documentation = "https://github.com/westerveltco/django-email-relay#readme" +Documentation = "https://django-email-relay.westervelt.dev" Issues = "https://github.com/westerveltco/django-email-relay/issues" Source = "https://github.com/westerveltco/django-email-relay"