leforestier / yattag

Python library to generate HTML or XML in a readable, concise and pythonic way.
328 stars 31 forks source link

Standardize packaging system #79

Open derekbarbosa opened 7 months ago

derekbarbosa commented 7 months ago

Hi there,

Not sure if this is stale or not (given the two open issues that haven't had any resolution) but I came across project looking for some sort of static simple HTML generation from some scripts I have been using for a while now.

Anyway, I noticed that this project still uses the setup.py method of installation. In fact, doing a pip install yattag from within my venv prompts the following message:

DEPRECATION: yattag is being installed using the legacy 'setup.py install' method, 
because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. 

Pip 23.1 will enforce this behaviour change. 

A possible replacement is to enable the '--use-pep517' option. 

Discussion can be found at https://github.com/pypa/pip/issues/8559

While setup.py is not fully deprecated for the time being (the installation still ran successfully) , I propose that converting the current setup.py project structure to include a pyproject.toml (as demonstrated by this guide).

This will also allow for installation locally using pip install .

A quick-and-dirty example could be as follows (please validate prior to copy-pasting using the linked docs):


[build-system] # backend build system
requires = ["setuptools"] 
build-backend = "setuptools.build_meta"

[project] # metadata
name = "yattag"
authors = [
    {name = "Benjamin Le Forestier", email = "benjamin@leforestier.org"},
]
license = {text = "LGPL-2.1"}
version = "1.15.2"
readme = "README.rst"
requires-python = ">=3.5"
dependencies = [
    "typing",
]
urls = { Project-URL = Website, https://www.yattag.org }
description  = "Generate HTML or XML in a pythonic way. Pure python alternative to web template engines & can fill HTML forms with default values and error messages."
keywords = [
    "html", 
    "template", 
    "templating", 
    "xml", 
    "document", 
    "form", 
    "rendering",
]

[project.scripts] # the entry point

If you have any other alternatives for a simple HTML generator such as this (if the project is deemed stale and no longer in development) please let me know and close the issue.

leforestier commented 6 months ago

Hello Derek,

thanks for bringing up that issue.

I didn't know that the setup.py method for installation was getting deprecated.

The project is not stale but I don't have much time to put into it at the moment. If you want to add a pyproject.toml to the project, I will happily review a pull request.

derekbarbosa commented 3 months ago

Hi,

Sorry for never getting around to this. I don't typically check my personal github account.

I can give it a shot and see if it will build locally.