diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index fffb988..6bdbfee 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -22,10 +22,13 @@ Unreleased * Rich text format lists can now be of length 2. * gptables now supports python 3.11 * Official disclaimer included at the bottom of the README and PyPI index +* pyproject.toml is now used to manage the packaging **Removed** * CI for Python 3.6 on Linux, as no longer supported by GitHub action ``setup-python`` +* Dataclasses as a dependency due to no longer supporting Python 3.6 +* setup.py as this has been replaced by the more modern pyproject.toml **Changed** diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..685cbd4 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +exclude = ["test"] + +[project] +name = "gptables" +authors = [ + {name = "Analysis Standards and Pipelines", email = "ASAP@ons.gov.uk"} +] +maintainers = [ + {name = "Analysis Standards and Pipelines", email = "ASAP@ons.gov.uk"} +] +dynamic = ["version"] +requires-python = '>=3.7' +description = 'Simplifying good practice in statistical tables.' +readme = "README.rst" +license = {text = "MIT License"} +keywords=["reproducible", "tables", "excel", "xlsxwriter", "reproducible-analytical-pipelines"] +classifiers = [ + "Programming Language :: Python :: 3", + "Operating System :: OS Independent" +] +dependencies = [ + "pandas>=0.25.3", + "xlrd>=1.2.0", + "XlsxWriter>=1.2.6", + "pyyaml>=3.12" +] + +[project.optional-dependencies] +docs = [ + "sphinx>=2", + "sphinx_rtd_theme" +] +testing = [ + "sphinx>=2", + "sphinx_rtd_theme", + "coverage", + "pytest>=6.2.5", + "pytest-cov" +] + +[project.urls] +Homepage = "https://github.com/best-practice-and-impact/gptables" +Documentation = "https://gptables.readthedocs.io/en/latest/" \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 948de71..0000000 --- a/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pandas>=0.25.3 -xlrd>=1.2.0 -XlsxWriter>=3.1.0 -pyyaml>=3.12 -dataclasses;python_version<"3.7" diff --git a/setup.py b/setup.py deleted file mode 100644 index ce05e20..0000000 --- a/setup.py +++ /dev/null @@ -1,51 +0,0 @@ -from setuptools import setup, find_packages - -def read_requirements(file): - with open(file) as f: - return f.read().splitlines() - -def read_file(file): - with open(file) as f: - return f.read() - -long_description = read_file("README.rst") -version = read_file("VERSION") -requires = read_requirements("requirements.txt") - -docs_requires = [ - "sphinx>=2", - "sphinx_rtd_theme" - ] + requires - -test_requires = [ - "coverage", - "pytest>=6.2.5", - "pytest-cov" -] + docs_requires - -setup( - name = 'gptables', - version = version, - author = 'David Foster, Rowan Hemsi', - author_email = 'david.foster@ons.gov.uk, rowan.hemsi@ons.gov.uk', - maintainer = 'Rowan Hemsi', - maintainer_email = 'rowan.hemsi@ons.gov.uk', - url = 'https://gptables.readthedocs.io/en/latest/', - keywords="reproducible tables excel xlsxwriter reproducible-analytical-pipelines", - description = 'Simplifying good practice in statistical tables.', - long_description_content_type = "text/x-rst", - long_description = long_description, - license = "MIT license", - packages = find_packages(exclude=["test"]), - include_package_data = True, - install_requires = requires, - extras_require = { - "docs": docs_requires, - "testing": test_requires - }, - classifiers = [ - "Programming Language :: Python :: 3", - "Operating System :: OS Independent" - ], - python_requires = '>=3.6', -)