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

Remove support for python < 3.9 #107

Merged
merged 3 commits into from
Apr 2, 2024
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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.2
current_version = 0.7.3-dev0
commit = False
allow_dirty = True
tag = False
Expand Down
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 24.2.0 # stable 0
rev: 24.3.0 # stable 0
hooks:
- id: black
language_version: python3
Expand All @@ -39,7 +39,7 @@ repos:
hooks:
- id: flake8
args: ['--max-line-length=88', '--show-source']
additional_dependencies: [wemake-python-styleguide]
additional_dependencies: [wemake-python-styleguide >= 0.19.2]

- repo: local
hooks:
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
2 changes: 1 addition & 1 deletion flask_nav3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def __len__(self):
return len(self._elems)


class Nav(object):
class Nav:
"""The Flask-Nav extension.

:param app: An optional :class:`~flask.Flask` app to initialize.
Expand Down
2 changes: 1 addition & 1 deletion flask_nav3/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from flask_nav3 import get_renderer


class NavigationItem(object):
class NavigationItem:
"""Base for all items in a Navigation.

Every item inside a navigational view should derive from this class.
Expand Down
730 changes: 549 additions & 181 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "flask-nav3"
description = "Easily create navigation for Flask applications."
version = "0.7.2"
version = "0.7.3-dev0"
license = "MIT"

authors = [
Expand All @@ -17,7 +17,8 @@ documentation = "https://flask-nav3.readthedocs.io/en/stable"
keywords = []

classifiers = [
"Programming Language :: Python :: 3.8",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -26,7 +27,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
python = ">=3.9,<4.0"
flask = ">=2.2.2,<4.0.0"
visitor = "^0.1.3"
dominate = "^2.9"
Expand All @@ -36,18 +37,17 @@ dominate = "^2.9"
optional = true

[tool.poetry.group.test.dependencies]
mypy = "^1.8"
wemake-python-styleguide = "^0.18"
mypy = "^1.9"
wemake-python-styleguide = "^0.19"
flake8-pytest-style = "^1.6"
doc8 = "^1.0"
nitpick = "^0.35"
safety = ">=2.3,<4.0"
pytest = ">=7.4,<9.0"
pytest-cov = "^4.0"
pytest-cov = ">=4,<6"
pytest-randomly = "^3.12"
isort = "^5.13"
black = ">=23.12,<25.0"
setuptools = "^69.0"
packaging = ">=22,<24"
importlib-metadata = { version = "<5.0", python = "<3.8" }
testfixtures = ">=7.0.4,<9.0.0"

Expand Down
Loading