Skip to content

Restructure pyMBE as a package #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented May 30, 2025

Fixes #13

Description of changes:

  • parameter files and the lib/ folder now belong to the pyMBE package
  • all other files (samples, tutorials, maintainer scripts, paper scripts, etc.) still belong to the pyMBE project, but they don't get deployed when installing the pyMBE package
  • function pmb.get_resource() was removed

@jngrad
Copy link
Member Author

jngrad commented May 30, 2025

Note: pdoc automatically creates an empty landing page for package modules. Comment lines were added in the readme file to populate the landing page with something useful. Here is a preview of the new documentation:
https://jngrad.github.io/pyMBE/pyMBE.html

You can test packaging locally by creating a new file setup.py at the top-level of your git clone and populating it with:

from setuptools import find_packages, setup

with open("README.md", "r") as f:
    long_description = f.read()

with open("requirements.txt") as f:
    required = f.read().splitlines()

setup(
    name="pyMBE",
    version="0.8.0",
    author="David Beyer, Pablo M. Blanco, et al.",
    author_email="[email protected]",
    description="Toolkit to facilitate building up molecules with complex architectures in the molecular dynamics software ESPResSo.",
    long_description=long_description,
    long_description_content_type="text/markdown",
    packages=find_packages(),
    python_requires=">=3.10",
    install_requires=required,
)

Then install pyMBE in a fresh virtual environment with:

python3 -m venv venv-local
source venv-local/bin/activate
python3 maintainer/configure_venv.py --espresso_path=/home/jgrad/espresso/build # adapt path
pip install .  # install pyMBE and its dependencies automatically
cd testsuite   # important: leave the current folder! otherwise Python imports the local pyMBE folder
python3 bond_tests.py

Please note setup.py is deprecated in favor of toml files. For more details, see this chapter in the pip documentation. The example above is only meant as a sanity check. Packaging pyMBE on PyPI is not within the scope of this PR.

@jngrad jngrad added this to the pyMBE 1.0.0 milestone May 30, 2025
@pm-blanco pm-blanco self-requested a review June 4, 2025 10:30
@pm-blanco pm-blanco added enhancement New feature or request code quality labels Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert pyMBE into a package
2 participants