From 071f351fca938f735e72395b8ecde6f0a856e4f0 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Wed, 30 Apr 2025 15:59:23 +0200 Subject: [PATCH] pep420 namespace package, add pyproject.toml, bump version --- pyproject.toml | 4 ++++ setup.py | 13 +++++++------ xstatic/__init__.py | 1 - xstatic/pkg/__init__.py | 1 - xstatic/pkg/pygments/__init__.py | 2 +- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 pyproject.toml delete mode 100644 xstatic/__init__.py delete mode 100644 xstatic/pkg/__init__.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..890c3fc --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,4 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + diff --git a/setup.py b/setup.py index a9986c3..366a582 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,14 @@ -from xstatic.pkg import pygments as xs +import os, sys +setup_dir = os.path.dirname(__file__) +sys.path.insert(0, os.path.join(setup_dir, "xstatic")) +from pkg import pygments as xs # The README.txt file should be written in reST so that PyPI can use # it to generate your project's PyPI page. with open('README.txt') as f: long_description = f.read() -from setuptools import setup, find_packages +from setuptools import setup, find_namespace_packages setup( name=xs.PACKAGE_NAME, @@ -19,10 +22,8 @@ license=xs.LICENSE, url=xs.HOMEPAGE, platforms=xs.PLATFORMS, - packages=find_packages(), - namespace_packages=['xstatic', 'xstatic.pkg', ], + packages=find_namespace_packages(), include_package_data=True, zip_safe=False, - install_requires=[], # nothing! :) - # if you like, you MAY use the 'XStatic' package. + install_requires=['XStatic >= 2.0.0, < 3.0.0'], ) diff --git a/xstatic/__init__.py b/xstatic/__init__.py deleted file mode 100644 index de40ea7..0000000 --- a/xstatic/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/xstatic/pkg/__init__.py b/xstatic/pkg/__init__.py deleted file mode 100644 index de40ea7..0000000 --- a/xstatic/pkg/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/xstatic/pkg/pygments/__init__.py b/xstatic/pkg/pygments/__init__.py index a26e4e6..04a263b 100644 --- a/xstatic/pkg/pygments/__init__.py +++ b/xstatic/pkg/pygments/__init__.py @@ -13,7 +13,7 @@ VERSION = '2.9.0' # version of the packaged files, please use the upstream # version number -BUILD = '1' # our package build number, so we can release new builds +BUILD = '2' # our package build number, so we can release new builds # with fixes for xstatic stuff. PACKAGE_VERSION = VERSION + '.' + BUILD # version used for PyPi