-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add setuptools config, set up versioneer #597
Conversation
9d698c7
to
92a838f
Compare
These can be installed via `pip install .[dev]`
black | ||
pytest | ||
pytest-cov | ||
pre-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dev and testing dependencies can be installed via pip install .[dev]
or pip install .[test]
respectively.
This will also apply when run outside of pre-commit
7e020f2
to
ce7d5c2
Compare
Force-pushed to remove some local configuration I had accidentally committed. |
@@ -10,7 +10,7 @@ repos: | |||
rev: 21.10b0 | |||
hooks: | |||
- id: black | |||
args: [--line-length=120] | |||
exclude: '^versioneer.py$|^timemachine/_version.py' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately these exclusions need to be duplicated here from pyproject.toml
(unless we want to use force-exclude, which would prevent any invocation of black from formatting these files; see psf/black#438)
@@ -29,7 +29,7 @@ if(NOT EXISTS ${EIGEN_SRC_DIR}) | |||
execute_process(COMMAND git clone --branch 3.3.9 https://gitlab.com/libeigen/eigen.git ${EIGEN_SRC_DIR}) | |||
endif() | |||
|
|||
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/${PYBIND_SRC_DIR}) | |||
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/${PYBIND_SRC_DIR} ${CMAKE_CURRENT_BINARY_DIR}/${PYBIND_SRC_DIR}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this I get
CMake Error at CMakeLists.txt:32 (add_subdirectory):
add_subdirectory not given a binary directory but the given source
directory
...
When specifying an out-of-tree source a binary directory must be explicitly
specified.
@@ -65,7 +65,13 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/eigen) | |||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/${CUB_SRC_DIR}) | |||
|
|||
set_property(TARGET ${LIBRARY_NAME} PROPERTY CUDA_STANDARD 14) | |||
|
|||
if (NOT CUDA_ARCH) | |||
set(CUDA_ARCH "75") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to allow pip install .
to succeed without needing to first set e.g. CMAKE_ARGS="-DCUDA_ARCH=75"
e515551
to
04bc8e7
Compare
Moving this to draft status as there are still a few issues to work out with the setuptools build. |
Default value is now configured in CMakeLists.txt
@@ -6,8 +6,6 @@ PYTEST_CI_ARGS := --cov=. --cov-report=term-missing | |||
|
|||
NPROCS = `nproc` | |||
|
|||
CUDA_ARCH := "70" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default CUDA_ARCH
setting was moved to CMakeLists.txt. This will allow pip install -e .
to succeed without needing to set the CMake flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These seem like great changes. Tested out the updated instructions for installing in develop mode and it all worked as expected. (Also quite nice to be able to access timemachine.__version__
from within a script!)
setup.py
, adapted from https://github.com/pypa/sampleproject/blob/main/setup.pymake build
still worksCUDA_ARCH
is now defined in CMakeLists.txt (as opposed to Makefile)CUDA_ARCH
to75
(this is what we're using in ansible builds)Versioning
Currently we get
After tagging, e.g.
we'll get
After the next (untagged) commit, it'll look like