From 4f6ee7774d60c6e49564a0d632ccb840249595b3 Mon Sep 17 00:00:00 2001 From: ye11owSub Date: Sun, 12 May 2024 11:28:15 +0300 Subject: [PATCH] moving project meta and packages search to pyproject.toml --- pyproject.toml | 36 ++++++++++++++++++++++++++++++++++++ setup.py | 43 +++++++------------------------------------ 2 files changed, 43 insertions(+), 36 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..c3aa8cf5f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,36 @@ +[project] +name = "pymol" +readme = "README.md" +requires-python = ">=3.9" +license = {file = "LICENSE"} +description = """ +PyMOL is a Python-enhanced molecular graphics tool. +It excels at 3D visualization of proteins, small molecules, density, +surfaces, and trajectories. It also includes molecular editing, +ray tracing, and movies. Open Source PyMOL is free to everyone! +""" +dynamic=["version"] +authors = [ + {name = "Schrodinger", email = "pymol-users@lists.sourceforge.net"}, +] + +[project.scripts] +pymol = "pymol:__main__" + +[build-system] +requires = ["setuptools>=61.0", "numpy>=1.26.4"] +build-backend = "setuptools.build_meta" + +[tool.setuptools.packages.find] +where = ["modules"] + +[tool.setuptools.package-data] +"pmg_qt" = ["forms/*.ui"] + +[project.urls] +Homepage = "https://pymol.org" +Documentation = "https://pymol.org/dokuwiki" +Repository = "https://github.com/schrodinger/pymol-open-source" +"Bug Tracker" = "https://github.com/schrodinger/pymol-open-source/issues" +Changelog = "https://github.com/schrodinger/pymol-open-source/blob/master/ChangeLog" + diff --git a/setup.py b/setup.py index eb18dd137..13d896eb4 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,13 @@ from distutils.util import change_root import create_shadertext +import monkeypatch_distutils + +# Important: import 'distutils.command' modules after monkeypatch_distutils +from distutils.command.build_ext import build_ext +from distutils.command.build_py import build_py +from distutils.command.install import install + # non-empty DEBUG variable turns off optimization and adds -g flag DEBUG = bool(os.getenv('DEBUG', '')) @@ -72,7 +79,6 @@ class options: sys.argv.append("--help") if True: - import monkeypatch_distutils monkeypatch_distutils.set_parallel_jobs(options.jobs) @@ -137,11 +143,6 @@ def guess_msgpackc(): return 'no' -# Important: import 'distutils.command' modules after monkeypatch_distutils -from distutils.command.build_ext import build_ext -from distutils.command.build_py import build_py -from distutils.command.install import install - class build_ext_pymol(build_ext): def initialize_options(self): build_ext.initialize_options(self) @@ -511,22 +512,6 @@ def get_sources(subdirs, suffixes=('.c', '.cpp')): return sorted([f for d in subdirs for s in suffixes for f in glob.glob(d + '/*' + s)]) -def get_packages(base, parent='', r=None): - from os.path import join, exists - if r is None: - r = [] - if parent: - r.append(parent) - for name in os.listdir(join(base, parent)): - if '.' not in name and exists(join(base, parent, name, '__init__.py')): - get_packages(base, join(parent, name), r) - return r - - -package_dir = dict((x, os.path.join(base, x)) - for base in ['modules'] - for x in get_packages(base)) - ext_modules += [ Extension("pymol._cmd", get_sources(pymol_src_dirs), @@ -551,20 +536,6 @@ def get_packages(base, parent='', r=None): 'build_py': build_py_pymol, 'install': install_pymol, }, - name="pymol", version=get_pymol_version(), - author="Schrodinger", - url="http://pymol.org", - contact="pymol-users@lists.sourceforge.net", - description=("PyMOL is a Python-enhanced molecular graphics tool. " - "It excels at 3D visualization of proteins, small molecules, density, " - "surfaces, and trajectories. It also includes molecular editing, " - "ray tracing, and movies. Open Source PyMOL is free to everyone!"), - - package_dir=package_dir, - packages=list(package_dir), - package_data={'pmg_qt': ['forms/*.ui']}, - ext_modules=ext_modules, - data_files=data_files, )