Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do some cleanup before initial release #100

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 2 additions & 47 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 .

Expand Down Expand Up @@ -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 #
##################
Expand Down
6 changes: 4 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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"

Expand Down