mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
Compare commits
1 Commits
v3.2.0
...
versioningit
| Author | SHA1 | Date | |
|---|---|---|---|
| cc0fe78382 |
+12
-1
@@ -1,6 +1,6 @@
|
||||
# Development Sandbox
|
||||
|
||||
Set up a development sandbox.
|
||||
## Setup
|
||||
|
||||
Acquire sources and install project in editable mode.
|
||||
```shell
|
||||
@@ -11,6 +11,8 @@ source .venv/bin/activate
|
||||
pip install --editable '.[graphql,develop,release,test]'
|
||||
```
|
||||
|
||||
## Operations
|
||||
|
||||
Invoke linter and software tests.
|
||||
```shell
|
||||
poe check
|
||||
@@ -20,3 +22,12 @@ Format code.
|
||||
```shell
|
||||
poe format
|
||||
```
|
||||
|
||||
|
||||
## Release
|
||||
|
||||
```shell
|
||||
git tag v2.1.0
|
||||
git push --tags
|
||||
poe release
|
||||
```
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
# ruff: noqa: S605, S607
|
||||
"""
|
||||
Build and publish a .deb package.
|
||||
https://pypi.python.org/pypi/stdeb/0.8.5#quickstart-2-just-tell-me-the-fastest-way-to-make-a-deb
|
||||
"""
|
||||
|
||||
import os
|
||||
from shutil import rmtree
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
|
||||
def get_version():
|
||||
import responder
|
||||
|
||||
return responder.__version__
|
||||
|
||||
|
||||
def run():
|
||||
version = get_version()
|
||||
try:
|
||||
print("Removing previous builds")
|
||||
rmtree(os.path.join(here, "deb_dist"))
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
print("Creating Debian package manifest")
|
||||
os.system(
|
||||
"python setup.py --command-packages=stdeb.command sdist_dsc "
|
||||
"-z artful --package3=pipenv --depends3=python3-virtualenv-clone"
|
||||
)
|
||||
print("Building .deb")
|
||||
os.chdir(f"deb_dist/pipenv-{version}")
|
||||
os.system("dpkg-buildpackage -rfakeroot -uc -us")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
+2
-14
@@ -20,23 +20,11 @@
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = "responder"
|
||||
copyright = "2018, A Kenneth Reitz project"
|
||||
copyright = "2024, A Kenneth Reitz project"
|
||||
author = "Kenneth Reitz"
|
||||
|
||||
# The short X.Y version
|
||||
import os
|
||||
|
||||
# Path hackery to get current version number.
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
about = {}
|
||||
with open(os.path.join(here, "..", "..", "responder", "__version__.py")) as f:
|
||||
exec(f.read(), about)
|
||||
|
||||
version = about["__version__"]
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = about["__version__"]
|
||||
|
||||
version = ""
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
build-backend = "setuptools.build_meta"
|
||||
requires = [
|
||||
"setuptools>=42", # At least v42 of setuptools required.
|
||||
"versioningit",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 90
|
||||
|
||||
extend-exclude = [
|
||||
"bin/mkdeb.py",
|
||||
"docs/source/conf.py",
|
||||
"setup.py",
|
||||
]
|
||||
@@ -69,6 +71,8 @@ markers = [
|
||||
]
|
||||
xfail_strict = true
|
||||
|
||||
[tool.versioningit]
|
||||
|
||||
[tool.poe.tasks]
|
||||
|
||||
check = [
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
from importlib.metadata import PackageNotFoundError, version
|
||||
|
||||
from . import ext
|
||||
from .core import API, Request, Response
|
||||
|
||||
try:
|
||||
__version__ = version("responder")
|
||||
except PackageNotFoundError: # pragma: no cover
|
||||
__version__ = "unknown"
|
||||
|
||||
__all__ = [
|
||||
"API",
|
||||
"Request",
|
||||
"Response",
|
||||
"ext",
|
||||
"__version__",
|
||||
]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
__version__ = "2.0.7"
|
||||
@@ -2,21 +2,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import codecs
|
||||
import os
|
||||
import sys
|
||||
from shutil import rmtree
|
||||
|
||||
from setuptools import Command, find_packages, setup
|
||||
from setuptools import find_packages, setup
|
||||
from versioningit import get_cmdclasses
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as f:
|
||||
long_description = "\n" + f.read()
|
||||
|
||||
about = {}
|
||||
|
||||
with open(os.path.join(here, "responder", "__version__.py")) as f:
|
||||
exec(f.read(), about)
|
||||
|
||||
required = [
|
||||
"aiofiles",
|
||||
"apispec>=1.0.0b1",
|
||||
@@ -31,43 +25,8 @@ required = [
|
||||
"whitenoise",
|
||||
]
|
||||
|
||||
|
||||
# https://pypi.python.org/pypi/stdeb/0.8.5#quickstart-2-just-tell-me-the-fastest-way-to-make-a-deb
|
||||
class DebCommand(Command):
|
||||
"""Support for setup.py deb"""
|
||||
|
||||
description = "Build and publish the .deb package."
|
||||
user_options = []
|
||||
|
||||
@staticmethod
|
||||
def status(s):
|
||||
"""Prints things in bold."""
|
||||
print("\033[1m{0}\033[0m".format(s))
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
self.status("Removing previous builds…")
|
||||
rmtree(os.path.join(here, "deb_dist"))
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
self.status("Creating debian manifest…")
|
||||
os.system(
|
||||
"python setup.py --command-packages=stdeb.command sdist_dsc -z artful --package3=pipenv --depends3=python3-virtualenv-clone"
|
||||
)
|
||||
self.status("Building .deb…")
|
||||
os.chdir("deb_dist/pipenv-{0}".format(about["__version__"]))
|
||||
os.system("dpkg-buildpackage -rfakeroot -uc -us")
|
||||
|
||||
|
||||
setup(
|
||||
name="responder",
|
||||
version=about["__version__"],
|
||||
description="A familiar HTTP Service Framework for Python.",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
@@ -103,5 +62,5 @@ setup(
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
"Topic :: Internet :: WWW/HTTP",
|
||||
],
|
||||
cmdclass={"deb": DebCommand},
|
||||
cmdclass=get_cmdclasses(),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user