Skip to content

Commit

Permalink
feat: replace pipenv with pdm
Browse files Browse the repository at this point in the history
  • Loading branch information
sysid committed Nov 19, 2023
1 parent 415d647 commit 4b008d9
Show file tree
Hide file tree
Showing 8 changed files with 863 additions and 108 deletions.
13 changes: 0 additions & 13 deletions .bumpversion.cfg

This file was deleted.

1 change: 1 addition & 0 deletions .pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/Users/Q187392/dev/s/public/sse-starlette/.venv/bin/python
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ upload: ## upload to PyPi

.PHONY: bump-major
bump-major: ## bump-major, tag and push
bumpversion --commit --tag major
bump-my-version bump --commit --tag major
git push
git push --tags
@$(MAKE) create-release

.PHONY: bump-minor
bump-minor: ## bump-minor, tag and push
bumpversion --commit --tag minor
bump-my-version bump --commit --tag minor
git push
git push --tags
@$(MAKE) create-release

.PHONY: bump-patch
bump-patch: ## bump-patch, tag and push
bumpversion --commit --tag patch
bump-my-version bump --commit --tag patch
git push
git push --tags
@$(MAKE) create-release
Expand All @@ -69,7 +69,7 @@ create-release: ## create a release on GitHub via the gh cli
TESTING: ## ############################################################
.PHONY: test
test: ## run tests
python -m pytest -ra --junitxml=report.xml --cov-config=setup.cfg --cov-report=xml --cov-report term --cov=$(pkg_src) tests/
python -m pytest -ra --junitxml=report.xml --cov-config=pyproject.toml --cov-report=xml --cov-report term --cov=$(pkg_src) tests/

.PHONY: tox
tox: ## Run tox
Expand Down Expand Up @@ -98,8 +98,8 @@ flake8: ## check style with flake8

.PHONY: mypy
mypy: ## check type hint annotations
# keep config in setup.cfg for integration with PyCharm
mypy --config-file setup.cfg $(pkg_src)
# keep config in pyproject.toml for integration with PyCharm
mypy --config-file pyproject.toml $(pkg_src)

################################################################################
# Clean \
Expand Down
737 changes: 737 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

122 changes: 118 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,120 @@
[build-system]
requires = [
"setuptools >= 42",
"wheel"
requires = ["pdm-backend"]
build-backend = "pdm.backend"

[project]
name = "sse-starlette"
version = "1.8.0"
description = "SSE plugin for Starlette"
readme = "README.md"
license = {text = "BSD-3-Clause"}
requires-python = ">=3.8"
authors = [
{ name = "sysid", email = "[email protected]" },
]
build-backend = "setuptools.build_meta"
url = "https://github.com/sysid/sse-starlette"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"starlette",
"uvicorn",
"fastapi",
"anyio",
]
[project.urls]
Source = "https://github.com/sysid/sse-starlette"

[tool.bumpversion]
current_version = "1.8.0"
commit = true
tag = false
message = "Bump version to {new_version}"

[tool.bumpversion.file_patterns]
"sset_starlette/__init__.py" = [
{search = "__version__ = '{current_version}'", replace = "__version__ = '{new_version}'"},
]
"VERSION" = [
{search = "{current_version}", replace = "{new_version}"},
]
"pyproject.toml" = [
{search = "version = {current_version}", replace = "version = {new_version}"},
]

[[tool.bumpversion.files]]
filename = "VERSION"

[[tool.bumpversion.files]]
filename = "pyproject.toml"

[[tool.bumpversion.files]]
filename = "sse_starlette/__init__.py"

[tool.pdm.build]
excludes = ["./**/.git"]
package-dir = "src"
includes = ["sse_starlette"]
source-includes = ["tests", "CHANGELOG.md", "LICENSE", "README.md", "tox.ini"]
# editables backend doesn't work well with namespace packages
editable-backend = "path"

[[tool.pdm.source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[tool.pdm.dev-dependencies]
dev = [
"mypy",
"codecov",
"isort",
"pytest",
"pytest-cov",
"pytest-asyncio",
"httpx",
"asgi-lifespan",
"psutil",
]
[tool.pytest.ini_options]
markers = [
"integration: marks tests as integration tests",
]
asyncio_mode = "auto"
#addopts = "--cov=my_package --cov-report=term-missing"

[tool.isort]
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
line_length = 88

[tool.mypy]
ignore_missing_imports = false
namespace_packages = true

[tool.coverage.run]
source = ["sse_starlette"]
omit = [
"tests/*",
"**/__main__.py",
"**/.venv/*",
"**/site-packages/*",
]
branch = true

[tool.coverage.report]
show_missing = true
skip_covered = true
fail_under = 85
80 changes: 0 additions & 80 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312

[testenv]
deps =
Expand Down

0 comments on commit 4b008d9

Please sign in to comment.