Skip to content

Conversation

@SteveHespelt
Copy link

@SteveHespelt SteveHespelt commented Mar 10, 2025

Hi Joe,

I have a need for a HttpServer 'component' in various Python scripts, Jupyter notebooks, to handle incoming POSTs of XML and/or JSON, especially in a blocking 1-request only mode. So I did a quick search of existing PyPI packages, came across yours (picohttp), thought it would (with some minimal mods) meet my use cases quite well & without being too extensive for my simple use case. So I forked the project, made the changes, and added a few unittest based test files.

Hopefully you'll see some value in incorporating the changes? No offense if not.

I'm thinking of adding a simple pyproject.toml, to generate a wheel file so the use of rutifu is embedded in the resulting wheel's metadata... (since that's the only non-stdlib dependency). If you think that's useful, I can do so before any action is taken on this PR. I appreciate any suggestions, feedback as well.

Hope this PR finds you doing well. And thank you for creating picohttp. It will be useful.

added unittests for blocking server
…=True

will terminate accept() looping

Fair amount of code formatting cleanup.
Cleanup (to some extent) comments, doc strings.
removed pyproject.toml from .gitignore since we're now using it.
TODO:  get intended version value from Joe Buehl before PR merging. update pyproject.toml with intended value.
…-Files

pyproject.toml, setuptools properties.
@jbuehl
Copy link
Owner

jbuehl commented Mar 12, 2025

Thanks for this PR. It looks like something I will probably add to the project, but I don't have time to review it just now.

@SteveHespelt
Copy link
Author

SteveHespelt commented Mar 12, 2025 via email

@jbuehl
Copy link
Owner

jbuehl commented Mar 14, 2025

I already have a pyproject.toml, however I am ignoring it with git, along with the dist/ and picohttp.egg-info/ directories that are involved in the PyPI distribution. I was unclear whether it belongs in the github repo or not. I think adding the rutifu dependency is a good idea though. I don't have much experience with this, so I don't know what the [tools.*] sections in your PR are for. Here's what I currently have:

[project]
name = "picohttp"
version = "0.0.10"
authors = [
  { name="Joe Buehl", email="jbuehl@buehltech.com" },
]
description = "A very minimal HTTP server"
readme = "README.md"
requires-python = ">=3.5"
classifiers = [
    "Programming Language :: Python :: 3",
    "License :: OSI Approved :: GNU General Public License (GPL)",
    "Operating System :: POSIX :: Linux",
    "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
]
[project.urls]
"Homepage" = "https://github.com/jbuehl/picohttp"
"Bug Tracker" = "https://github.com/jbuehl/picohttp/issues"
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants