Skip to content
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

refactor: use src/{package} layout #145

Merged
merged 1 commit into from
Jun 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake/_version.py export-subst
src/cmake/_version.py export-subst
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This project
archive-cache
cmake/data/*
src/cmake/data/*
env.json
skbuild
src
CMake-src
standalone-build
standalone-x86-build
standalone-x64-build
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ if(CMakePythonDistributions_SUPERBUILD)
# CMakeProject_SOURCE_DIR: Always expect the sources (needed for `sdist`)
#
if(NOT DEFINED CMakeProject_SOURCE_DIR)
set(CMakeProject_SOURCE_DIR "${CMAKE_SOURCE_DIR}/src")
set(CMakeProject_SOURCE_DIR "${CMAKE_SOURCE_DIR}/CMake-src")

# Download selected source archive
ExternalProject_add(CMakeProject-src-download
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include LICENSE_Apache_20
include LICENSE_BSD_3

recursive-exclude _skbuild *
recursive-exclude src *
recursive-exclude CMake-src *

include versioneer.py
include cmake/_version.py
include src/cmake/_version.py
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ show-source: True
# Maximum cyclomatic complexity allowed
max-complexity: 14
format: pylint
exclude: .git,.idea,.eggs,__pycache__,.tox,docs/conf.py,_skbuild,src,versioneer.py
exclude: .git,.idea,.eggs,__pycache__,.tox,docs/conf.py,_skbuild,CMake-src,versioneer.py

[tool:pytest]
testpaths = tests
addopts = -v --cov --cov-report xml

[versioneer]
VCS = git
versionfile_source = cmake/_version.py
versionfile_source = src/cmake/_version.py
versionfile_build = cmake/_version.py
style = pep440-post
tag_prefix = ''
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ def parse_requirements(filename):
author='Jean-Christophe Fillion-Robin',
author_email='jchris.fillionr@kitware.com',

package_dir={'': 'src'},
packages=['cmake'],

cmake_install_dir='cmake/data',
cmake_install_dir='src/cmake/data',

entry_points={
'console_scripts': [
Expand Down Expand Up @@ -90,4 +91,4 @@ def parse_requirements(filename):
install_requires=requirements,
tests_require=dev_requirements,
setup_requires=setup_requires
)
)
4 changes: 2 additions & 2 deletions cmake/__init__.py → src/cmake/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
# Since building the project specifying --plat-name or CMAKE_OSX_* variables
# leads to different SKBUILD_DIR, the code below attempt to guess the most
# likely plat-name.
_skbuild_dirs = os.listdir(os.path.join(os.path.dirname(__file__), '..', '_skbuild'))
_skbuild_dirs = os.listdir(os.path.join(os.path.dirname(__file__), '..', '..', '_skbuild'))
if _skbuild_dirs:
_likely_plat_name = '-'.join(_skbuild_dirs[0].split('-')[:3])
set_skbuild_plat_name(_likely_plat_name)

_cmake_data = os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', SKBUILD_CMAKE_INSTALL_DIR(), 'cmake/data'))
os.path.dirname(__file__), '..', '..', SKBUILD_CMAKE_INSTALL_DIR(), 'src/cmake/data'))
if os.path.exists(_cmake_data):
CMAKE_DATA = _cmake_data

Expand Down
File renamed without changes.