From 56daf94d9114a9a9097e27865ca21900a2195834 Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 30 Dec 2024 09:29:21 -0700 Subject: [PATCH 1/7] Remove Mypy as dependency when installing outside of linux * Mypy only used when generating the stubs for the C++ build. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 57dc59bd4..396489188 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ follow_imports = "silent" requires = [ # Don't need cmake if not on linux "cmake==3.24.3; sys_platform == 'linux'", - "mypy==1.5.1", + "mypy==1.5.1; sys_platform == 'linux'", "setuptools >= 43.0.0, < 64.0.0", "wheel", "versioneer-518" From 68b65266a6c477bcc4981c0fe780ac37fbd3f144 Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 30 Dec 2024 09:31:10 -0700 Subject: [PATCH 2/7] Store C++ files in package data * Ensures that can upload package to pypi and be installable. * Adopt the convention of package data described in https://setuptools.pypa.io/en/latest/userguide/datafiles.html#subdirectory-for-data-files --- setup.py | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/setup.py b/setup.py index 124b9e80d..7436c8f6d 100644 --- a/setup.py +++ b/setup.py @@ -128,19 +128,27 @@ def build_extension(self, ext): }, package_data={ "timemachine": [ - "datasets/**/*.csv", - "datasets/**/*.pdb", - "datasets/**/*.sdf", "py.typed", - "testsystems/data/**/*.pdb", - "testsystems/data/**/*.sdf", + ], + "timemachine.datasets": [ + "**/*.csv", + "**/*.pdb", + "**/*.sdf", + ], + "timemachine.testsystems": [ + "**/*.pdb", + "**/*.sdf", + ], + "timemachine.cpp": [ + "**/*.h", + "**/*.cu", + "**/*.cuh", + "**/*.hpp", + "**/*.cpp", + "CMakeLists.txt", + "generate_stubs", ], }, - # entry_points={ - # "console_scripts": [ - # "sample=sample:main", - # ], - # }, project_urls={ "Bug Reports": "https://github.com/proteneer/timemachine/issues", "Source": "https://github.com/proteneer/timemachine/", From ff2c00c7ef75a47326b70d1feed0d04561ad3f68 Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 30 Dec 2024 09:43:35 -0700 Subject: [PATCH 3/7] Adds dist directory to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index f82dd39b5..c71117894 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ oe_license.txt *.swp .ipynb_checkpoints/ build/ +dist/ *.egg-info/ .coverage* .hypothesis/ From b2b056ee41847986c2a80724bf1388c055afaec2 Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 6 Jan 2025 08:57:45 -0700 Subject: [PATCH 4/7] Adds CI Job for packaging * To verify that we can package the repo and install it. --- .gitlab-ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0b4235c54..9f09a6042 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,27 @@ nocuda-tests: when: on_success expire_in: 1 week +packaging: + stage: lint + image: $DOCKER_TAG + needs: ["docker_build"] + tags: + - aws-tardis-cpu + rules: + - if: $CI_EXTERNAL_PULL_REQUEST_IID + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + # Specify cuda arch, so that a GPU is not required to detect the cuda arch. + variables: + CMAKE_ARGS: -DCUDA_ARCH=75 + script: + - python setup.py sdist + - pip install dist/timemachine-*.tar.gz + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME-packaging" + paths: + - dist/ + expire_in: 1 week + nogpu-tests: stage: test image: $DOCKER_TAG From b6fa09c005d53139c909c8127df48e2f43cb943c Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 6 Jan 2025 09:09:27 -0700 Subject: [PATCH 5/7] Trigger test failure --- setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 7436c8f6d..abd481ba8 100644 --- a/setup.py +++ b/setup.py @@ -139,15 +139,15 @@ def build_extension(self, ext): "**/*.pdb", "**/*.sdf", ], - "timemachine.cpp": [ - "**/*.h", - "**/*.cu", - "**/*.cuh", - "**/*.hpp", - "**/*.cpp", - "CMakeLists.txt", - "generate_stubs", - ], + # "timemachine.cpp": [ + # "**/*.h", + # "**/*.cu", + # "**/*.cuh", + # "**/*.hpp", + # "**/*.cpp", + # "CMakeLists.txt", + # "generate_stubs", + # ], }, project_urls={ "Bug Reports": "https://github.com/proteneer/timemachine/issues", From 2f20a7c0f50f5b9441b8171abed28be6c543bc0c Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 6 Jan 2025 09:21:01 -0700 Subject: [PATCH 6/7] Revert "Trigger test failure" This reverts commit b6fa09c005d53139c909c8127df48e2f43cb943c. --- setup.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index abd481ba8..7436c8f6d 100644 --- a/setup.py +++ b/setup.py @@ -139,15 +139,15 @@ def build_extension(self, ext): "**/*.pdb", "**/*.sdf", ], - # "timemachine.cpp": [ - # "**/*.h", - # "**/*.cu", - # "**/*.cuh", - # "**/*.hpp", - # "**/*.cpp", - # "CMakeLists.txt", - # "generate_stubs", - # ], + "timemachine.cpp": [ + "**/*.h", + "**/*.cu", + "**/*.cuh", + "**/*.hpp", + "**/*.cpp", + "CMakeLists.txt", + "generate_stubs", + ], }, project_urls={ "Bug Reports": "https://github.com/proteneer/timemachine/issues", From 030d20283e2b76de9e07573e8b48f391f2649fd5 Mon Sep 17 00:00:00 2001 From: Forrest York Date: Mon, 6 Jan 2025 09:25:41 -0700 Subject: [PATCH 7/7] Minor clean up of comment --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 396489188..fa58d43ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ follow_imports = "silent" [build-system] requires = [ - # Don't need cmake if not on linux + # Need cmake/mypy if building the C++, only supported on linux "cmake==3.24.3; sys_platform == 'linux'", "mypy==1.5.1; sys_platform == 'linux'", "setuptools >= 43.0.0, < 64.0.0",