diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 094d40f58..b641fd520 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: conda install -y python conda-build "grpcio-tools<1.62" conda-verify - name: Compiling the prototypes - run: python python-libraries/nanover-core/setup.py compile_proto --proto-dir=protocol + run: python ./python-libraries/compile_proto.py --proto-dir=./protocol --python-dir=./python-libraries/nanover-core/src - name: Building the Conda packages run: | $build_command \ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee776ff22..2f7842a8e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,8 +44,8 @@ jobs: run: conda install -y mpi4py openmm - name: Install tests dependancies run: python -m pip install -r python-libraries/requirements.test - - name: Compile - run: ./compile.sh --no-dotnet + - name: Compile (mypy requires --no-edit) + run: ./compile.sh --no-dotnet --no-edit - name: mypy run: | # Mypy accepts paths, modules or packages as inputs. However, only diff --git a/compile.sh b/compile.sh index 7ffce599e..d5c2b429b 100755 --- a/compile.sh +++ b/compile.sh @@ -63,13 +63,13 @@ if [[ $with_python == true ]]; then python -m pip install -r ./python-libraries/requirements.test ${user_option} announce "Compiling proto files to python" - python ./python-libraries/nanover-core/setup.py compile_proto + python ./python-libraries/compile_proto.py --proto-dir=./protocol --python-dir=./python-libraries/nanover-core/src announce "Installing the python packages" python -m pip install ${edit_option} ${nanover_user_option} ./python-libraries/nanover-core/ for package in python-libraries/nanover-*/; do - if [[ -f "${package}/setup.py" ]]; then + if [[ -f "${package}/pyproject.toml" ]]; then python -m pip install ${edit_option} ${nanover_user_option} ${package} fi done diff --git a/python-libraries/compile_proto.py b/python-libraries/compile_proto.py new file mode 100644 index 000000000..fe079434a --- /dev/null +++ b/python-libraries/compile_proto.py @@ -0,0 +1,130 @@ +import argparse +import os +import textwrap +from contextlib import contextmanager +from importlib import resources +from pathlib import Path + + +def handle_user_arguments(args=None) -> argparse.Namespace: + """ + Parse the arguments from the command line. + + :return: The namespace of arguments read from the command line. + """ + description = textwrap.dedent( + """\ + Compile the gRPC protocol files to python. + """ + ) + parser = argparse.ArgumentParser(description=description) + + parser.add_argument( + "--proto-dir", + required=True, + dest="proto_dir", + metavar="PATH", + help="The path to the directory containing the proto files", + ) + + parser.add_argument( + "--python-dir", + required=True, + dest="python_dir", + metavar="PATH", + help="The path to the directory where to generate the python files", + ) + + arguments = parser.parse_args(args) + return arguments + + +def compile_protocol(proto_dir, python_dir): + """ + Compile the protocol files to python. + + :param proto_dir: The path to the directory containing the proto files. + :param python_dir: The path to the directory where to generate the python files. + """ + from grpc_tools import protoc + + try: + os.makedirs(python_dir) + except OSError: + pass + + # Note on calling grpc_tools.protoc as a python function: + # grpc_tools.protoc.main is called by the command line with sys.argv and + # the include path for the default protobuf proto files. sys.argv is a list of + # the arguments passed to the command line, the first element of that list is + # the command itself; what is passed as a command does not matter, but the actual + # arguments must start at sys.argv[1] (hence "protoc" as first argument passed + # to the function). + proto_include = resources.files("grpc_tools") / "_proto" + with move_in_directory(proto_dir): + for protocol_file in Path(".").glob("**/*.proto"): + print(f"Compiling {protocol_file}") + protoc.main( + ( + "protoc", + "--proto_path=.", + f"--python_out={python_dir}", + f"--grpc_python_out={python_dir}", + str(protocol_file), + f"--proto_path={proto_include}", + ) + ) + generated_protocol_directories = ( + path for path in (python_dir / "nanover/protocol").glob("**/*") if path.is_dir() + ) + for directory in generated_protocol_directories: + (directory / "__init__.py").touch() + contained_files = (file for file in directory.glob("*_pb2*.py")) + with open(directory / "__init__.py", "w+") as init_py: + for contained_file in contained_files: + file_name = os.path.splitext(os.path.split(contained_file)[1])[0] + init_py.write("from .%s import *\n" % file_name) + + +@contextmanager +def move_in_directory(destination): + """ + Context manager that moves in the given directory. + + When the interpreter enters the context manager, the working directory becomes + the given destination. When the interpreter exists the context manager, the + working directory is restored to where the working directory was before entering. + + Example: + ======== + + >>> with move_in_directory("bar"): + >>> # working directory is "bar" + >>> pass + >>> # working directory is "foo" again + + :param destination: The directory to use as working directory. + """ + destination = Path(destination) + directory_to_restore = Path.cwd() + try: + os.chdir(str(destination)) + yield + finally: + os.chdir(str(directory_to_restore)) + + +def main(): + """ + Entry point for the command line. + """ + arguments = handle_user_arguments() + + compile_protocol( + Path(arguments.proto_dir).resolve(), + Path(arguments.python_dir).resolve(), + ) + + +if __name__ == "__main__": + main() diff --git a/python-libraries/nanover-ase/pyproject.toml b/python-libraries/nanover-ase/pyproject.toml new file mode 100644 index 000000000..42ad61bcc --- /dev/null +++ b/python-libraries/nanover-ase/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-ase" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "ASE integration for NanoVer" +readme = "README.md" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "ase >= 3.21", +] +dynamic = ["version"] + +[project.scripts] +nanover-omm-ase = "nanover.ase.openmm.cli:main" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-ase/setup.py b/python-libraries/nanover-ase/setup.py deleted file mode 100644 index 38135eba1..000000000 --- a/python-libraries/nanover-ase/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-ase", - version="0.1.0", - description="ASE integration for NanoVer", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "ase>=3.21", - ), - entry_points={ - "console_scripts": ["nanover-omm-ase=nanover.ase.openmm.cli:main"], - }, -) diff --git a/python-libraries/nanover-core/conda/bld.bat b/python-libraries/nanover-core/conda/bld.bat deleted file mode 100644 index 602113031..000000000 --- a/python-libraries/nanover-core/conda/bld.bat +++ /dev/null @@ -1,2 +0,0 @@ -"%PYTHON%" setup.py install -if errorlevel 1 exit 1 \ No newline at end of file diff --git a/python-libraries/nanover-core/pyproject.toml b/python-libraries/nanover-core/pyproject.toml new file mode 100644 index 000000000..2afa88ebd --- /dev/null +++ b/python-libraries/nanover-core/pyproject.toml @@ -0,0 +1,29 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "NanoVer python framework" +requires-python = ">=3.11" +dependencies = [ + "setuptools>=40.1.1", + "grpcio>=1.63.0", + "grpcio-tools>=1.63.0", + "pytest", + "aiogrpc", + "numpy", + "hypothesis", + "typing_extensions", +] +dynamic = ["version"] + +[project.scripts] +nanover-multiplayer = "nanover.multiplayer.cli:main" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*", "nanover.protocol"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-core/setup.py b/python-libraries/nanover-core/setup.py deleted file mode 100644 index 89c41cd65..000000000 --- a/python-libraries/nanover-core/setup.py +++ /dev/null @@ -1,161 +0,0 @@ -# !/usr/bin/env python - - -import os -from contextlib import contextmanager -from pathlib import Path -import distutils.cmd -import distutils.log -from distutils.core import setup -from setuptools import find_namespace_packages -from importlib import resources - - -class CompileProtoCommand(distutils.cmd.Command): - """ - Custom command to compile the protocol files. - - To run the command, call:: - - python setup.py compile_proto - - While it is not recommended, it is possible to run the compilation with a - different set of protocol files by passing the --proto-dir option: - - python setup.py compile_proto --proto-dir=../other-proto-files - - """ - - description = "Compile the protocol files." - user_options = [ - # The format is (long option, short option, description) - ("proto-dir=", None, "Path to the directory containing the protocol files."), - ] - - def initialize_options(self): - """ - Set the default values for the options. - """ - # By default, the setup.py file is in nanover-protocol/python-libraries/nanover-core, - # the protocol files are in nanover-protocol/protocol, which is ../../protocol relative - # to the directory of setup.py. - here = Path(__file__).parent - self.proto_dir = here / "../../protocol" - - def finalize_options(self): - """ - Post-process options. - """ - self.proto_dir = Path(self.proto_dir) - assert ( - self.proto_dir.exists - ), "The prototype directory {} does not exist.".format(self.proto_dir) - - def run(self): - """ - Run the compilation. - """ - self.announce("Compile protocol files.", level=distutils.log.INFO) - setup_path = Path(__file__).parent.resolve() - compile_protocol(self.proto_dir, setup_path / "src", self) - - -def compile_protocol(proto_dir, python_dir, logger): - """ - Compile the protocol files to python. - - :param proto_dir: The path to the directory containing the proto files. - :param python_dir: The path to the directory where to generate the python files. - :param logger: The logger instance used by distutils. - """ - from grpc_tools import protoc - - # Note on calling grpc_tools.protoc as a python function: - # grpc_tools.protoc.main is called by the command line with sys.argv and - # the include path for the default protobuf proto files. sys.argv is a list of - # the arguments passed to the command line, the first element of that list is - # the command itself; what is passed as a command does not matter, but the actual - # arguments must start at sys.argv[1] (hence "protoc" as first argument passed - # to the function). - proto_include = resources.files("grpc_tools") / "_proto" - with move_in_directory(proto_dir): - for protocol_file in Path(".").glob("**/*.proto"): - logger.announce( - "Compiling {}".format(protocol_file), level=distutils.log.INFO - ) - protoc.main( - ( - "protoc", - "--proto_path=.", - "--python_out=" + str(python_dir), - "--grpc_python_out=" + str(python_dir), - str(protocol_file), - "--proto_path={}".format(proto_include), - ) - ) - generated_protocol_directories = ( - path for path in (python_dir / "nanover/protocol").glob("**/*") if path.is_dir() - ) - for directory in generated_protocol_directories: - (directory / "__init__.py").touch() - contained_files = (file for file in directory.glob("*_pb2*.py")) - with open(directory / "__init__.py", "w+") as init_py: - for contained_file in contained_files: - file_name = os.path.splitext(os.path.split(contained_file)[1])[0] - init_py.write("from .%s import *\n" % file_name) - - -@contextmanager -def move_in_directory(destination): - """ - Context manager that moves in the given directory. - - When the interpreter enters the context manager, the working directory becomes - the given destination. When the interpreter exists the context manager, the - working directory is restored to where the working directory was before entering. - - Example: - ======== - - >>> with move_in_directory("bar"): - >>> # working directory is "bar" - >>> pass - >>> # working directory is "foo" again - - :param destination: The directory to use as working directory. - """ - destination = Path(destination) - directory_to_restore = Path.cwd() - try: - os.chdir(str(destination)) - yield - finally: - os.chdir(str(directory_to_restore)) - - -# Avoid repeating the content of requirements.txt here. -# The requirements.txt file is in the same directory as this setup.py, -# we then should now were the setup lies to be independent of the working -# directory. -requirements_path = Path(__file__).parent.resolve() / "requirements.txt" -with open(str(requirements_path)) as f: - requirements = f.readlines() - -setup( - name="nanover", - version="1.0", - description="NanoVer python framework", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*") + ["nanover.protocol"], - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=requirements, - cmdclass={ - "compile_proto": CompileProtoCommand, - }, - entry_points={ - "console_scripts": ["nanover-multiplayer=nanover.multiplayer.cli:main"], - }, -) diff --git a/python-libraries/nanover-core/tests/core/test_nanover_client_server_state.py b/python-libraries/nanover-core/tests/core/test_nanover_client_server_state.py index 42412151b..ac0be4d63 100644 --- a/python-libraries/nanover-core/tests/core/test_nanover_client_server_state.py +++ b/python-libraries/nanover-core/tests/core/test_nanover_client_server_state.py @@ -3,6 +3,8 @@ import numpy import pytest + +from nanover.testing import assert_in_soon from nanover.utilities.change_buffers import DictionaryChange from nanover.utilities.key_lockable_map import ResourceLockedError @@ -80,7 +82,8 @@ def test_client_copy_state_is_independent(client_server): client, server = client_server client.subscribe_all_state_updates(0) - time.sleep(IMMEDIATE_REPLY_WAIT_TIME) + # wait for first update + assert_in_soon(lambda: "test", lambda: client.copy_state()) copy = client.copy_state() copy["test"]["baby"] = "shark" diff --git a/python-libraries/nanover-essd/conda/meta.yaml b/python-libraries/nanover-essd/conda/meta.yaml index e60293a1a..b42fc6720 100644 --- a/python-libraries/nanover-essd/conda/meta.yaml +++ b/python-libraries/nanover-essd/conda/meta.yaml @@ -8,6 +8,8 @@ source: build: noarch: python number: 0 + entry_points: + - nanover-essd-list = nanover.essd.list_cli:main requirements: build: diff --git a/python-libraries/nanover-essd/pyproject.toml b/python-libraries/nanover-essd/pyproject.toml new file mode 100644 index 000000000..779bc11f1 --- /dev/null +++ b/python-libraries/nanover-essd/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-essd" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "Extremely Simple Server Discovery, for use with NanoVer" +requires-python = ">=3.11" +dependencies = [ + "netifaces", +] +dynamic = ["version"] + +[project.scripts] +nanover-essd-list = "nanover.essd.list_cli:main" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-essd/setup.py b/python-libraries/nanover-essd/setup.py deleted file mode 100644 index ea31fb80a..000000000 --- a/python-libraries/nanover-essd/setup.py +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-essd", - version="1.0.0", - description="Extremely Simple Server Discovery, for use with NanoVer", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_data={"": ["py.typed"]}, - install_requires=("netifaces",), - entry_points={ - "console_scripts": ["nanover-essd-list=nanover.essd.list_cli:main"], - }, - package_dir={"": "src"}, -) diff --git a/python-libraries/nanover-jupyter/pyproject.toml b/python-libraries/nanover-jupyter/pyproject.toml new file mode 100644 index 000000000..304c2f0c3 --- /dev/null +++ b/python-libraries/nanover-jupyter/pyproject.toml @@ -0,0 +1,22 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-jupyter" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "Utilities for using Jupyter with NanoVer" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "MDAnalysis", + "numpy", + "nglview", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-jupyter/setup.py b/python-libraries/nanover-jupyter/setup.py deleted file mode 100644 index 5ec51ac13..000000000 --- a/python-libraries/nanover-jupyter/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-jupyter", - version="0.1.0", - description="NGLView python client for NanoVer", - author="Intangible Realities Lab", - author_email="harry.stroud@usc.es", - url="https://github.com/IRL2/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "MDAnalysis", - "numpy", - "nglview", - ), -) diff --git a/python-libraries/nanover-lammps/pyproject.toml b/python-libraries/nanover-lammps/pyproject.toml new file mode 100644 index 000000000..21be654bd --- /dev/null +++ b/python-libraries/nanover-lammps/pyproject.toml @@ -0,0 +1,21 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-lammps" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "LAMMPS integration for NanoVer" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "mpi4py", + "numpy", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-lammps/setup.py b/python-libraries/nanover-lammps/setup.py deleted file mode 100644 index cbaf8b4e9..000000000 --- a/python-libraries/nanover-lammps/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-lammps", - version="0.1.0", - description="LAMMPS integration for NanoVer", - author="Intangible Realities Lab", - author_email="simonbennie@gmail.com", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "mpi4py", - "numpy", - ), -) diff --git a/python-libraries/nanover-mdanalysis/pyproject.toml b/python-libraries/nanover-mdanalysis/pyproject.toml new file mode 100644 index 000000000..a538c473c --- /dev/null +++ b/python-libraries/nanover-mdanalysis/pyproject.toml @@ -0,0 +1,20 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-mdanalysis" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "MDAnalysis integration for NanoVer" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "MDAnalysis", +] +dynamic = ["version"] + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-mdanalysis/setup.py b/python-libraries/nanover-mdanalysis/setup.py deleted file mode 100644 index 3f9c26aa4..000000000 --- a/python-libraries/nanover-mdanalysis/setup.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python - - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-mdanalysis", - version="0.1.0", - description="MDAnalysis integration for NanoVer", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "MDAnalysis", - ), -) diff --git a/python-libraries/nanover-omni/pyproject.toml b/python-libraries/nanover-omni/pyproject.toml new file mode 100644 index 000000000..5e804a05c --- /dev/null +++ b/python-libraries/nanover-omni/pyproject.toml @@ -0,0 +1,23 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-omni" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "Multi-simulation server for NanoVer" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "openmm", +] +dynamic = ["version"] + +[project.scripts] +nanover-omni = "nanover.omni.cli:main" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-omni/setup.py b/python-libraries/nanover-omni/setup.py deleted file mode 100644 index 096bffa49..000000000 --- a/python-libraries/nanover-omni/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-omni", - version="0.1.0", - description="Omni server for NanoVer", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "openmm", - ), - entry_points={ - "console_scripts": ["nanover-omni=nanover.omni.cli:main"], - }, -) diff --git a/python-libraries/nanover-openmm/pyproject.toml b/python-libraries/nanover-openmm/pyproject.toml new file mode 100644 index 000000000..5204466aa --- /dev/null +++ b/python-libraries/nanover-openmm/pyproject.toml @@ -0,0 +1,23 @@ +[build-system] +requires = ["setuptools", "setuptools-scm"] +build-backend = "setuptools.build_meta" + +[project] +name = "nanover-openmm" +authors = [ + {name = "Intangible Realities Lab"}, +] +description = "Multi-simulation server for NanoVer" +requires-python = ">=3.11" +dependencies = [ + "nanover", + "openmm", +] +dynamic = ["version"] + +[project.scripts] +nanover-omm-server = "nanover.openmm.cli:main" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["nanover.*"] # package names should match these glob patterns (["*"] by default) diff --git a/python-libraries/nanover-openmm/setup.py b/python-libraries/nanover-openmm/setup.py deleted file mode 100644 index ff19c138c..000000000 --- a/python-libraries/nanover-openmm/setup.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup -from setuptools import find_namespace_packages - -setup( - name="nanover-openmm", - version="0.1.0", - description="OpenMM server for NanoVer", - author="Intangible Realities Lab", - author_email="m.oconnor@bristol.ac.uk", - url="https://gitlab.com/intangiblerealities/", - packages=find_namespace_packages("src", include="nanover.*"), - package_dir={"": "src"}, - package_data={"": ["py.typed"]}, - install_requires=( - "nanover", - "openmm", - ), - entry_points={ - "console_scripts": ["nanover-omm-server=nanover.openmm.cli:main"], - }, -) diff --git a/win_compile.ps1 b/win_compile.ps1 index 73371725a..e73ac34c5 100644 --- a/win_compile.ps1 +++ b/win_compile.ps1 @@ -38,13 +38,13 @@ announce "Installing python test requirements" python -m pip install -r ./python-libraries/requirements.test ${user_option} announce "Compiling proto files to python" -python ./python-libraries/nanover-core/setup.py compile_proto +python ./python-libraries/compile_proto.py --proto-dir=./protocol --python-dir=./python-libraries/nanover-core/src announce "Installing the python packages" python -m pip install ${edit_option} ${user_option} ./python-libraries/nanover-core/ Get-ChildItem -Directory python-libraries/nanover-* | ForEach-Object { - if (Test-Path -Path "$($_.FullName)/setup.py") { + if (Test-Path -Path "$($_.FullName)/pyproject.toml") { Write-Host "$($_.FullName)" pip install ${edit_option} ${user_option} ""$($_.FullName)"" }