From 52e15daf6bb8345c7fc1b6ee5068caa38b77abb9 Mon Sep 17 00:00:00 2001 From: Jad Chaar Date: Mon, 4 Sep 2023 01:24:42 -0700 Subject: [PATCH] Migrate from setup.py to pyproject.toml to support flit package distributions --- MANIFEST.in | 4 --- Makefile | 6 ++--- ideas.md | 2 -- pyproject.toml | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 49 ---------------------------------- 5 files changed, 74 insertions(+), 58 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 ideas.md create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 953be57..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include LICENSE CHANGELOG.md README.rst Makefile tox.ini -recursive-include requirements *.txt -recursive-include tests *.py -recursive-include docs *.py *.rst *.bat Makefile diff --git a/Makefile b/Makefile index b7bcb6c..6a8b924 100644 --- a/Makefile +++ b/Makefile @@ -42,10 +42,10 @@ clean: clean-dist clean-dist: rm -rf dist build .egg .eggs sec_edgar_downloader.egg-info -build-dist: +build-dist: clean-dist . venv/bin/activate; \ - pip install -U setuptools twine wheel; \ - python setup.py sdist bdist_wheel + pip install -U flit; \ + flit build upload-dist: . venv/bin/activate; \ diff --git a/ideas.md b/ideas.md deleted file mode 100644 index 1feada1..0000000 --- a/ideas.md +++ /dev/null @@ -1,2 +0,0 @@ -1. Add caching to API requests: https://pypi.org/project/requests-cache/ -1. Add logging with log module and verbose logging option diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..89b5cce --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[build-system] +requires = ["flit_core >=3.2,<4"] +build-backend = "flit_core.buildapi" + +[project] +name = "sec-edgar-downloader" +authors = [{name = "Jad Chaar", email = "jad.chaar@gmail.com"}] +readme = "README.rst" +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: Financial and Insurance Industry", + "Natural Language :: English", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: Office/Business :: Financial", + "Topic :: Office/Business :: Financial :: Investment", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3 :: Only", + "Operating System :: OS Independent", +] +dependencies = [ + "requests", + "pyrate-limiter>=3.1.0" +] +requires-python = ">=3.8" +description = "Download SEC filings from the EDGAR database using Python" +keywords = [ + "sec", + "edgar", + "filing", + "financial", + "finance", + "stocks", + "mutual-funds", + "sec.gov" +] +dynamic = ["version"] + +[project.optional-dependencies] +test = [ + "pre-commit", + "pytest", + "pytest-cov" +] +doc = [ + "doc8", + "sphinx", + "sphinx-autobuild", + "sphinx-autodoc-typehints" +] + +[project.urls] +Documentation = "https://sec-edgar-downloader.readthedocs.io" +Source = "https://github.com/jadchaar/sec-edgar-downloader" +Issues = "https://github.com/jadchaar/sec-edgar-downloader/issues" + +[tool.flit.sdist] +exclude = [ + "tests/test_data/", +] + +[tool.flit.module] +name = "sec_edgar_downloader" diff --git a/setup.py b/setup.py deleted file mode 100644 index ebf0e9a..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -from pathlib import Path - -from setuptools import setup - -readme = Path("README.rst").read_text(encoding="utf-8") -version = Path("sec_edgar_downloader/_version.py").read_text(encoding="utf-8") -about = {} -exec(version, about) - -setup( - name="sec-edgar-downloader", - version=about["__version__"], - license="MIT", - author="Jad Chaar", - author_email="jad.chaar@gmail.com", - description="Download SEC filings from the EDGAR database using Python.", - long_description=readme, - long_description_content_type="text/x-rst", - url="https://github.com/jadchaar/sec-edgar-downloader", - packages=["sec_edgar_downloader"], - zip_safe=False, - install_requires=["requests", "pyrate-limiter>=3.1.0"], - python_requires=">=3.8", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: Information Technology", - "Intended Audience :: Financial and Insurance Industry", - "Natural Language :: English", - "Topic :: Software Development :: Libraries :: Python Modules", - "Topic :: Office/Business :: Financial", - "Topic :: Office/Business :: Financial :: Investment", - "License :: OSI Approved :: MIT License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3 :: Only", - "Operating System :: OS Independent", - ], - keywords="sec edgar filing financial finance stocks mutual-funds sec.gov", - project_urls={ - "Bug Reports": "https://github.com/jadchaar/sec-edgar-downloader/issues", - "Repository": "https://github.com/jadchaar/sec-edgar-downloader", - "Documentation": "https://sec-edgar-downloader.readthedocs.io", - }, -)