Skip to content

Commit 7d556b3

Browse files
committed
Fix: build process of wheel file
1 parent aca3d1e commit 7d556b3

File tree

5 files changed

+24
-34
lines changed

5 files changed

+24
-34
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To build the wheel file, follow these steps (the working directory is the reposi
2424

2525
1. Set up the build environment by running:
2626
```powershell
27-
.\vendor\taskfile\bin\task.exe setup-build-env
27+
.\setup_dev_env.bat
2828
```
2929

3030
2. Once the environment is set up and **activated**, build the wheel file with:
@@ -36,7 +36,8 @@ To build the wheel file, follow these steps (the working directory is the reposi
3636
.\.venv\Scripts\python.exe .\run_automation.py build-wheel
3737
```
3838
39-
3. After the build process completes, you can find the generated wheel file in the `dist` folder located in the project root.
39+
3. After the build process completes, you can find the generated wheel file in the `dist` folder located in the project root.
40+
(Until now the wheel file has a wrong filename containing _none_ and _any_ but is only for **Windows x64**.)
4041
4142
Feel free to contribute or test the files as needed.
4243

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ authors = [
1414
{name = "Schrodinger", email = "pymol-users@lists.sourceforge.net"},
1515
{name = "Martin Urban",email = "martin.urban@studmail.w-hs.de"}
1616
]
17+
classifiers = [
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.11",
20+
"Operating System :: Microsoft :: Windows"
21+
]
1722

1823
[build-system]
1924
requires = ["setuptools", "numpy==1.26.4", "toml"]

run_automation.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,25 @@ def clean_install() -> None:
157157
)
158158

159159

160+
def copy_pymol_python_sources() -> None:
161+
"""Copies the pymol python sources to the src/python directory."""
162+
tmp_src_path = pathlib.Path(PROJECT_ROOT_DIR / "src/python")
163+
tmp_pymol_python_src_path = pathlib.Path(PROJECT_ROOT_DIR / "vendor/pymol-open-source/modules")
164+
if not tmp_src_path.exists():
165+
tmp_src_path.mkdir(parents=True)
166+
shutil.copytree(
167+
tmp_pymol_python_src_path,
168+
tmp_src_path,
169+
dirs_exist_ok=True
170+
)
171+
172+
160173
def build_wheel() -> None:
161174
"""Builds the wheel file for the python PyMOL package."""
162175
# Run the command using subprocess.run
176+
copy_pymol_python_sources()
163177
subprocess.run(
164-
[PYTHON_EXECUTABLE, 'setup.py', 'sdist', 'bdist_wheel'],
178+
[PYTHON_EXECUTABLE, 'setup.py', 'bdist_wheel'], # sdist does not create the correct directory hierarchy
165179
stdout=sys.stdout, stderr=sys.stderr, text=True
166180
)
167181

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535

3636
class CustomInstall(install):
37+
"""Custom command for running pip install ."""
3738

3839
def copy_pymol_python_sources(self) -> None:
3940
"""Copies the pymol python sources to the src/python directory."""
@@ -49,7 +50,6 @@ def copy_pymol_python_sources(self) -> None:
4950
def run(self) -> None:
5051
"""Run method that gets executed if pip install is run."""
5152
self.run_command("build_ext")
52-
self.copy_pymol_python_sources()
5353
super().run()
5454
if not DEBUG:
5555
shutil.rmtree(pathlib.Path(PROJECT_ROOT_DIR / "src"))

setup_dev_env.sh

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)