Skip to content

Commit

Permalink
Merge pull request #33 from jmichalicek/readthedocs-v2-config
Browse files Browse the repository at this point in the history
add readthedocs v2 config and move stuff to /django/djfractions/ in dev container
  • Loading branch information
jmichalicek committed Nov 25, 2023
2 parents d02c407 + 33de1e7 commit d124b3e
Show file tree
Hide file tree
Showing 10 changed files with 615 additions and 20 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,24 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
django-version: ["django==3.2.*", "django==4.1.*", "django==4.2.*"]
exclude:
- python-version: "3.11"
django-version: "django==3.2.*"
- python-version: "3.7"
django-version: "django==4.1.*"
- python-version: "3.7"
django-version: "django==4.2.*"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
# there's probably a better way to do this, but this should be good enough
# for now to deal with no hash on the pip install for django
run: |
python -m pip install --upgrade pip
pip install ${{ matrix.django-version }} -r requirements-test.txt
pip install ${{ matrix.django-version }}
pip install -r requirements-test.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
Expand All @@ -39,4 +38,4 @@ jobs:
- name: Run Tests
run: |
coverage run --source djfractions runtests.py
coverage report
coverage report
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7 AS dev
FROM python:3.8 AS dev
#FROM python:3.10.5-bullseye AS dev
LABEL maintainer="Justin Michalicek <[email protected]>"
ENV PYTHONUNBUFFERED 1
Expand All @@ -15,5 +15,5 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteract
RUN pip install pip -U
RUN useradd -ms /bin/bash -d /django django && echo "django ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER django
ENV HOME=/django PATH=/django/bash-shell.net/.venv/bin:/django/.local/bin:$PATH LC_ALL=C.UTF-8 LANG=C.UTF-8 PYTHONIOENCODING=utf-8
ENV HOME=/django PATH=/django/djfractions/.venv/bin:/django/.local/bin:$PATH LC_ALL=C.UTF-8 LANG=C.UTF-8 PYTHONIOENCODING=utf-8
EXPOSE 8000
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dev:
docker compose run --service-ports django /bin/bash

install-frac:
pip install -e /django/bash-shell.net --no-binary :all:
pip install -e /django/djfractions --no-binary :all:

shell:
docker compose exec django bash
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ services:
depends_on:
- database
- redis
working_dir: /django/bash-shell.net
working_dir: /django/djfractions
# command: /home/developer/docker_entrypoints/dev_entrypoint.sh
build:
context: .
Expand All @@ -43,8 +43,7 @@ services:
- "8000:8000"
restart: on-failure
volumes:
- .:/django/bash-shell.net/
- ~/.git-hooks:/django/.git-hooks:ro
- .:/django/djfractions/
- ~/.gitconfig:/django/.gitconfig:ro
- ~/.ssh:/django/.ssh:ro
volumes:
Expand Down
19 changes: 19 additions & 0 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM python:3.11

LABEL maintainer="Justin Michalicek <[email protected]>"
ENV PYTHONUNBUFFERED 1

RUN DEBIAN_FRONTEND=noninteractive apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
inotify-tools \
software-properties-common \
sudo \
vim \
telnet \
postgresql-client \
&& apt-get autoremove && apt-get clean

RUN pip install pip -U
RUN useradd -ms /bin/bash -d /django django && echo "django ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER django
ENV HOME=/django PATH=/django/djfractions/docs/.venv/bin:/django/.local/bin:$PATH LC_ALL=C.UTF-8 LANG=C.UTF-8 PYTHONIOENCODING=utf-8
EXPOSE 8000
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx
242 changes: 242 additions & 0 deletions docs/requirements.txt

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions requirements-test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage
coveralls
flake8
typing-extensions # for backported typing stuff
mypy
django-stubs
tox
Loading

0 comments on commit d124b3e

Please sign in to comment.