Skip to content

Commit

Permalink
chore: Remove support for python < 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Quien Sabe committed Apr 2, 2024
1 parent aee350f commit 8253ddb
Show file tree
Hide file tree
Showing 4 changed files with 592 additions and 214 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: "1.7.1"
version: "1.8.2"
virtualenvs-in-project: true

- name: Set up cache
Expand Down
58 changes: 34 additions & 24 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
SHELL:=/usr/bin/env bash

PROJECT ?= $(shell git rev-parse --show-toplevel)
DISTRO ?= ubuntu20.04
PYVERS = 3.10.9
PROJECT_NAME ?= $(shell basename $$(git rev-parse --show-toplevel) | sed -e "s/^python-//")
PACKAGE_DIR ?= $(shell echo $(PROJECT_NAME) | tr "-" "_")
PROJECT_VERSION ?= $(shell grep ^current_version .bumpversion.cfg | awk '{print $$NF'} | tr '-' '.')
WHEELS ?= /home/jim/kbfs/private/jim5779/wheels
TEST_MASK = tests
GITHUB_ORG ?= wtf-guru

.PHONY: black mypy lint sunit unit package test publish publish-test chlog
.PHONY: vars black mypy lint sunit unit package test publish publish-test update

.PHONY: update
update:
poetry update --with test --with docs

vars:
@echo "PROJECT_NAME: $(PROJECT_NAME)"
@echo "PACKAGE_DIR: $(PACKAGE_DIR)"
@echo "PROJECT_VERSION: $(PROJECT_VERSION)"

black:
poetry run isort .
poetry run black .
poetry run isort $(PACKAGE_DIR) $(TEST_MASK)
poetry run black $(PACKAGE_DIR) $(TEST_MASK)

mypy: black
poetry run mypy flask_nav3 tests/*.py
poetry run mypy $(PACKAGE_DIR) $(TEST_MASK)

lint: mypy
poetry run flake8 .
poetry run flake8 $(PACKAGE_DIR) $(TEST_MASK)
poetry run doc8 -q docs

sunit:
Expand All @@ -30,33 +37,37 @@ unit:
package:
poetry check
poetry run pip check
poetry run safety check --full-report

test: lint package unit

publish: test clean
publish: clean-build test
manage-tag.sh -u v$(PROJECT_VERSION)
poetry publish --build

publish-test: test clean
publish-test: clean-build test
manage-tag.sh -u v$(PROJECT_VERSION)
poetry publish --build -r test-pypi

.PHONY: work37 work38 work
work37:
docker run --pull --rm -it --volume $(PROJECT):/project/ qs5779/python-testing:ubuntu20.04-3.7.16 /bin/bash

work38:
docker run --pull --rm -it --volume $(PROJECT):/project/ qs5779/python-testing:ubuntu20.04-3.8.16 /bin/bash

work:
docker run --pull --rm -it --volume $(PROJECT):/project/ qs5779/python-testing:$(DISTRO)-$(PYVERS) /bin/bash
.PHONY: build
build: clean-build test
manage-tag.sh -u v$(PROJECT_VERSION)
poetry build
cp dist/$(PROJECT_NAME)-$(PROJECT_VERSION)-py3-none-any.whl $(WHEELS)
sync-wheels

.PHONY: chlog docs
chlog:
github_changelog_generator -u wtfo-guru -p flask-nav3
github_changelog_generator -u $(GITHUB_ORG) -p $(PROJECT_NAME)
sed -i -e '/^$$/N;/^\n$$/D' ./CHANGELOG.md
m2r2 --overwrite --anonymous-references CHANGELOG.md
sed -i '/This Changelog was automatically generated by/d' ./CHANGELOG.rst
mv -f ./CHANGELOG.rst ./docs/pages/changelog.rst
poetry run doc8 -q docs

docs:
@cd docs && $(MAKE) $@

.PHONY: clean clean-build clean-pyc clean-test
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts

Expand All @@ -80,7 +91,6 @@ clean-test: ## remove test and coverage artifacts
rm -fr htmlcov/
rm -fr .pytest_cache
rm -fr .mypy_cache
rm -fr .cache


.DEFAULT:
@cd docs && $(MAKE) $@
# vim: ft=Makefile
Loading

0 comments on commit 8253ddb

Please sign in to comment.