Skip to content

Commit

Permalink
Migrate from Setuptools to Flit
Browse files Browse the repository at this point in the history
solve: #558
  • Loading branch information
nycholas committed Sep 11, 2024
1 parent 60654f0 commit 6f3debe
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 37 deletions.
3 changes: 1 addition & 2 deletions .devcontainer/on-create-command.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash
set -e

python3 -m venv .venv
python3 -m venv --upgrade-deps .venv
. .venv/bin/activate
pip install -U pip
pip install -r requirements/local.txt
pip install -e .
pre-commit install --install-hooks
2 changes: 1 addition & 1 deletion .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
merge-multiple: true
- name: Build source and wheel distributions to version ${{ github.ref_name }}
run: |
python -m pip install -r requirements/build.txt
python -m pip install -r requirements/build.txt twine
tar -xvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar
mv pre-release-cibw-wheels/* dist-${{ matrix.platform }}-${{ matrix.python-version }}/
twine check --strict dist-${{ matrix.platform }}-${{ matrix.python-version }}/*
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
merge-multiple: true
- name: Build source and wheel distributions to version ${{ github.ref_name }}
run: |
python -m pip install -r requirements/build.txt
python -m pip install -r requirements/build.txt twine
tar -xvf dist-${{ matrix.platform }}-${{ matrix.python-version }}.tar
mv release-cibw-wheels/* dist-${{ matrix.platform }}-${{ matrix.python-version }}/
twine check --strict dist-${{ matrix.platform }}-${{ matrix.python-version }}/*
Expand All @@ -115,8 +115,6 @@ jobs:
prerelease: false
generate_release_notes: true
files: |
COPYING
LICENSE
AUTHORS
LICENSE.txt
README.md
dist-${{ matrix.platform }}-${{ matrix.python-version }}/*
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
- release/**
tags-ignore:
- v**
paths-ignore:
- 'docs/**'
- '*.md'
issue_comment:
types: [created]

Expand Down
10 changes: 0 additions & 10 deletions AUTHORS

This file was deleted.

1 change: 0 additions & 1 deletion LICENSE

This file was deleted.

File renamed without changes.
3 changes: 1 addition & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
include tox.ini
include COPYING
include AUTHORS
include LICENSE.txt
include README.md
include requirements/*.txt
include src/flask_jsonrpc/py.typed
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@ clean:
@find . -name "*.pyc" | xargs rm -rf
@find . -name "__pycache__" | xargs rm -rf
@find . -name ".coverage" | xargs rm -rf
@rm -rf .coverage coverage.* .eggs/ .mypy_cache/ .pytype/ .ruff_cache/ .pytest_cache/ .tox/ src/Flask_JSONRPC.egg-info/ htmlcov/ junit/ htmldoc/ build/ dist/
@rm -rf .coverage coverage.* .eggs/ .mypy_cache/ .pytype/ .ruff_cache/ .pytest_cache/ .tox/ src/Flask_JSONRPC.egg-info/ htmlcov/ junit/ htmldoc/ build/ dist/ wheelhouse/

test: clean
@python -m pip install --upgrade tox
@python -m tox

test-release: clean test
@docker-compose -f docker-compose.test.yml build --build-arg VERSION=$(shell date +%s)
@docker-compose -f docker-compose.test.yml up

release: clean test
@python -m pip install --upgrade build
@python -m pip install --upgrade -r requirements/cbuild.txt
@python -m build
@MYPYC_ENABLE=1 python setup.py bdist_wheel

Expand All @@ -35,7 +36,6 @@ publish: clean release

env:
ifeq ($(VIRTUALENV_EXISTS), 0)
@python -m venv .venv
@.venv/bin/pip install --upgrade pip setuptools
@python -m venv --upgrade-deps .venv
@.venv/bin/pip install -r requirements/local.txt
endif
1 change: 0 additions & 1 deletion README

This file was deleted.

34 changes: 27 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
[build-system]
requires = ["setuptools>=61.0", "wheel>=0.42"]
build-backend = "backend"
backend-path = ["src/buildtools"]

[project]
name = "Flask-JSONRPC"
version = "4.0.0a0"
description = "Adds JSONRPC support to Flask."
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
license = {file = "LICENSE.txt"}
authors = [{name = "Nycholas Oliveira", email = "[email protected]"}]
maintainers = [{name = "Cenobit Technologies Inc.", email = "[email protected]"}]
keywords = ["flask", "flask-extensions", "jsonrpc"]
Expand Down Expand Up @@ -49,6 +44,26 @@ Documentation = "https://flask-jsonrpc.readthedocs.io/"
"Issue Tracker" = "https://github.com/cenobites/flask-jsonrpc/issues/"
Website = "https://flask-jsonrpc.readthedocs.io/"

[build-system]
requires = ["flit_core>=3.2,<4"]
build-backend = "flit_core.buildapi"
#backend-path = ["src/buildtools"]

[tool.flit.module]
name = "flask_jsonrpc"

[tool.flit.sdist]
include = [
"docs/",
"examples/",
"requirements/",
"tests/",
"tox.ini",
]
exclude = [
"docs/_build/",
]

[tool.setuptools]
zip-safe = false
include-package-data = true
Expand Down Expand Up @@ -144,6 +159,10 @@ testpaths = [
"src/flask_jsonrpc",
"tests",
]
filterwarnings = [
"error",
"ignore::pytest.PytestUnraisableExceptionWarning"
]
norecursedirs = [
"tests/test_apps",
"tests/integration",
Expand Down Expand Up @@ -201,6 +220,8 @@ python_version = "3.12"
check_untyped_defs = true
ignore_errors = false
ignore_missing_imports = false
show_error_codes = true
pretty = true
strict = true

[[tool.mypy.overrides]]
Expand All @@ -212,7 +233,6 @@ module = [
]
ignore_missing_imports = true


[tool.pytype]
inputs = ["src/flask_jsonrpc"]
python_version = "3.11"
Expand Down
5 changes: 0 additions & 5 deletions requirements/build.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
# Tools
# ------------------------------------------------------------------------------
wheel==0.44.0 # https://github.com/pypa/wheel
setuptools==74.1.2 # https://github.com/pypa/setuptools
build==1.2.2 # https://github.com/pypa/build
packaging==24.1 # https://github.com/pypa/packaging
pyproject-hooks==1.1.0 # https://github.com/pypa/pyproject-hooks
twine==5.1.1 # https://github.com/pypa/twine

0 comments on commit 6f3debe

Please sign in to comment.