Changeset - 8c51ee8735ca
[Not reviewed]
2 3 1
Lance Edgar - 5 months ago 2024-06-10 19:12:50
lance@edbob.org
feat: switch from setup.cfg to pyproject.toml + hatchling
6 files changed with 66 insertions and 63 deletions:
0 comments (0 inline, 0 general) First comment
.gitignore
Show inline comments
 
*~
 
*.pyc
 
dist/
 
rattail_fabric2.egg-info/
pyproject.toml
Show inline comments
 
new file 100644
 

	
 
[build-system]
 
requires = ["hatchling"]
 
build-backend = "hatchling.build"
 

	
 

	
 
[project]
 
name = "rattail-fabric2"
 
version = "0.3.6"
 
description = "Fabric (v2) Utilities for Rattail"
 
readme = "README.rst"
 
authors = [{name = "Lance Edgar", email = "lance@edbob.org"}]
 
license = {text = "GNU GPL v3+"}
 
classifiers = [
 
        "Development Status :: 3 - Alpha",
 
        "Environment :: Console",
 
        "Intended Audience :: Developers",
 
        "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
 
        "Natural Language :: English",
 
        "Operating System :: OS Independent",
 
        "Programming Language :: Python :: 3",
 
        "Topic :: System :: Systems Administration",
 
        "Topic :: Software Development :: Libraries :: Python Modules",
 
]
 
dependencies = [
 
        "fabric2",
 
        "invoke",
 
        "rattail",
 
        "six",
 
]
 

	
 

	
 
[project.urls]
 
Homepage = "https://rattailproject.org"
 
Repository = "https://kallithea.rattailproject.org/rattail-project/rattail-fabric2"
 
Changelog = "https://kallithea.rattailproject.org/rattail-project/rattail-fabric2/files/master/CHANGES.rst"
 

	
 

	
 
[tool.commitizen]
 
version_provider = "pep621"
 
tag_format = "v$version"
 
update_changelog_on_bump = true
rattail_fabric2/_version.py
Show inline comments
 
# -*- coding: utf-8; -*-
 

	
 
__version__ = '0.3.6'
 
try:
 
    from importlib.metadata import version
 
except ImportError:
 
    from importlib_metadata import version
 

	
 

	
 
__version__ = version('rattail-fabric2')
setup.cfg
Show inline comments
 
deleted file
setup.py
Show inline comments
 
deleted file
tasks.py
Show inline comments
 
@@ -25,13 +25,24 @@ Tasks for rattail-fabric2
 
"""
 

	
 
import os
 
import re
 
import shutil
 

	
 
from invoke import task
 

	
 

	
 
here = os.path.abspath(os.path.dirname(__file__))
 
exec(open(os.path.join(here, 'rattail_fabric2', '_version.py')).read())
 
__version__ = None
 
pattern = re.compile(r'^version = "(\d+\.\d+\.\d+)"$')
 
with open(os.path.join(here, 'pyproject.toml'), 'rt') as f:
 
    for line in f:
 
        line = line.rstrip('\n')
 
        match = pattern.match(line)
 
        if match:
 
            __version__ = match.group(1)
 
            break
 
if not __version__:
 
    raise RuntimeError("could not parse version!")
 

	
 

	
 
@task
 
@@ -39,9 +50,10 @@ def release(c):
 
    """
 
    Release a new version of 'rattail-fabric2'.
 
    """
 
    shutil.rmtree('rattail_fabric2.egg-info')
 
    if os.path.exists('rattail_fabric2.egg-info'):
 
        shutil.rmtree('rattail_fabric2.egg-info')
 
    # TODO: this seems heavy-handed? for sake of recursive-include in MANIFEST
 
    # TODO: what i esp. don't like is, this doesn't consider .gitignore
 
    c.run("find . -name '*~' -delete")
 
    c.run('python setup.py sdist --formats=gztar')
 
    c.run('python -m build --sdist')
 
    c.run(f'twine upload dist/rattail_fabric2-{__version__}.tar.gz')
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now