diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a422e3b8e..da80dbaf6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -32,5 +32,4 @@ jobs: env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} - run: | - pytest tests + run: pytest diff --git a/paperqa/version.py b/paperqa/version.py index 111dc9172..d12246efa 100644 --- a/paperqa/version.py +++ b/paperqa/version.py @@ -1 +1,5 @@ -__version__ = "4.3.0" +from importlib.metadata import version + +# If you're looking to bump the version, this now +# lives in the pyproject.toml's [project] section +__version__ = version("paper-qa") diff --git a/pyproject.toml b/pyproject.toml index 4e193fb10..1990f8f09 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,45 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = ["setuptools >= 61.0"] + +[project] +authors = [ + {email = "white.d.andrew@gmail.com", name = "Andrew White"}, +] +# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers +classifiers = [ + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python", +] +dependencies = [ + "PyCryptodome", + "html2text", + "numpy", + "openai>=1", + "pydantic>=2", + "pypdf", + "tiktoken>=0.4.0", +] +description = "LLM Chain for answering questions from docs" +keywords = ["question answering"] +license = {file = "LICENSE"} +maintainers = [ + {email = "jamesbraza@gmail.com", name = "James Braza"}, + {email = "white.d.andrew@gmail.com", name = "Andrew White"}, +] +name = "paper-qa" +readme = "README.md" +requires-python = ">=3.8" +urls = {repository = "https://github.com/whitead/paper-qa"} +version = "4.3.0" + [tool.codespell] check-filenames = true check-hidden = true @@ -55,6 +97,13 @@ module = [ "sentence_transformers", # SEE: https://github.com/UKPLab/sentence-transformers/issues/1723 ] +[tool.pytest.ini_options] +# List of directories that should be searched for tests when no specific directories, +# files or test ids are given in the command line when executing pytest from the rootdir +# directory. File system paths may use shell-style wildcards, including the recursive ** +# pattern. +testpaths = ["tests"] + [tool.ruff] # Line length to use when enforcing long-lines violations (like `E501`). line-length = 120 @@ -134,6 +183,9 @@ max-doc-length = 120 # Match line-length # defaults when analyzing docstring sections. convention = "google" +[tool.setuptools.packages.find] +include = ["paperqa*"] + [tool.tomlsort] all = true in_place = true diff --git a/setup.py b/setup.py deleted file mode 100644 index 6bc87745c..000000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -from setuptools import setup - -# for typing -__version__ = "" -exec(open("paperqa/version.py").read()) # noqa: S102, SIM115 - -with open("README.md", encoding="utf-8") as fh: - long_description = fh.read() - -setup( - name="paper-qa", - version=__version__, - description="LLM Chain for answering questions from docs ", - author="Andrew White", - author_email="white.d.andrew@gmail.com", - url="https://github.com/whitead/paper-qa", - license="Apache License 2.0", - packages=["paperqa", "paperqa.contrib"], - package_data={"paperqa": ["py.typed"]}, - install_requires=[ - "pypdf", - "pydantic>=2", - "openai>=1", - "numpy", - "PyCryptodome", - "html2text", - "tiktoken>=0.4.0", - ], - test_suite="tests", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - ], -)