From cb11564237585ff1b097e05dc5d13cc4739cfa1b Mon Sep 17 00:00:00 2001 From: Keith Maxwell Date: Sun, 14 Jan 2024 20:38:32 +0000 Subject: [PATCH] Migrate away from setup.cfg In preparation for https://github.com/pypa/setuptools/issues/3214 --- .flake8 | 8 ++++++++ pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++++++++++ setup.cfg | 48 ------------------------------------------------ setup.py | 5 ++--- 4 files changed, 55 insertions(+), 51 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..bf51b556 --- /dev/null +++ b/.flake8 @@ -0,0 +1,8 @@ +[flake8] +max-line-length = 88 +extend-ignore = E203 +exclude = + .git, + .venv, + __pycache__, + docs diff --git a/pyproject.toml b/pyproject.toml index fed528d4..2cf1108e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,48 @@ [build-system] requires = ["setuptools"] build-backend = "setuptools.build_meta" + +[project] +name = "qgridtrusted" +dynamic = ["version"] +readme = "README.md" +description = "An Interactive Grid for Sorting and Filtering DataFrames in Jupyter Notebook" +authors = [ + { name = "Quantopian Inc.", email = "opensource@quantopian.com" }, +] +license = { file = "LICENSE" } +dependencies = [ + "notebook", + "pandas", + "ipywidgets", +] +keywords = ["ipython", "jupyter", "widgets"] +classifiers = [ + "Development Status :: 4 - Beta", + "Framework :: IPython", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Office/Business :: Financial", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Multimedia :: Graphics", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", +] + +[project.urls] +Homepage = "https://github.com/maxwell-k/qgridtrusted/" + +[project.optional-dependencies] +test = ["pytest", "flake8"] + +[tool.setuptools] +zip-safe = false + +[tool.setuptools.dynamic] +version = { attr = "qgrid._version.__version__" } + +[tool.setuptools.packages.find] +where = ["."] +exclude = ["js"] +namespaces = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 984cd7c0..00000000 --- a/setup.cfg +++ /dev/null @@ -1,48 +0,0 @@ -[metadata] -name = qgridtrusted -version = attr: qgrid._version.__version__ -url = https://github.com/maxwell-k/qgridtrusted/ -author = Quantopian Inc. -author_email = opensource@quantopian.com -description = An Interactive Grid for Sorting and Filtering DataFrames in Jupyter Notebook -long_description = file: README.md -long_description_content_type = text/markdown -license = Apache-2.0 -license_files = LICENSE -keywords = ipython, jupyter, widgets -classifiers = - Development Status :: 4 - Beta - Framework :: IPython - Intended Audience :: Developers - Intended Audience :: Science/Research - Topic :: Office/Business :: Financial - Topic :: Scientific/Engineering :: Information Analysis - Topic :: Multimedia :: Graphics - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - -[options] -packages = - qgrid - qgrid.static -include_package_data = True -zip_safe = False -install_requires = - notebook - pandas - ipywidgets - -[flake8] -max-line-length = 88 -extend-ignore = E203 -exclude = - .git, - .venv, - __pycache__, - docs - -[options.extras_require] -test = - pytest - flake8 diff --git a/setup.py b/setup.py index bf1178c4..9f621427 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from setuptools.command.build_py import build_py from setuptools.command.sdist import sdist -STATIC = Path(__file__).parent / "qgrid" / "static" +STATIC = Path("qgrid") / "static" TARGETS = [STATIC / "extension.js", STATIC / "index.js"] STATIC.mkdir(exist_ok=True) @@ -39,8 +39,7 @@ def run(self): logging.error("`npm` unavailable.") else: logging.info("Running `npm install`. This may take a while.") - cwd = Path(__file__).parent / "js" - run(["npm", "install"], cwd=cwd, check=True) + run(["npm", "install"], cwd="js", check=True) if missing := [i for i in TARGETS if not i.is_file()]: raise ValueError("Missing files: %s" % missing)