Skip to content

Commit

Permalink
moving project meta and packages search to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
ye11owSub authored and ye11owSub committed May 20, 2024
1 parent 3943835 commit 4f6ee77
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 36 deletions.
36 changes: 36 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]"},
]

[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"

43 changes: 7 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''))
Expand Down Expand Up @@ -72,7 +79,6 @@ class options:
sys.argv.append("--help")

if True:
import monkeypatch_distutils
monkeypatch_distutils.set_parallel_jobs(options.jobs)


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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),
Expand All @@ -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="[email protected]",
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,
)

0 comments on commit 4f6ee77

Please sign in to comment.