Skip to content

Commit 3a9b3ce

Browse files
Satish615Satish Gollaprolu
andauthored
Use package_data to include commit_hash instead of data_files (#94)
* use package_data to include the COMMIT_HASH file instead of data_files Co-authored-by: Satish Gollaprolu <[email protected]>
1 parent 1c2344b commit 3a9b3ce

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

devtool

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ docs() {
5353

5454
create_commit_hash_file(){
5555
if [[ -z "${CODEBUILD_RESOLVED_SOURCE_VERSION:-}" ]]; then
56-
echo $(git rev-parse HEAD) > COMMIT_HASH
56+
echo $(git rev-parse HEAD) > src/smclarify/COMMIT_HASH
5757
else
58-
echo "${CODEBUILD_RESOLVED_SOURCE_VERSION}" > COMMIT_HASH
58+
echo "${CODEBUILD_RESOLVED_SOURCE_VERSION}" > src/smclarify/COMMIT_HASH
5959
fi
6060
}
6161

6262
build_package() {
6363
create_commit_hash_file
6464
python3 setup.py bdist_wheel
65-
rm COMMIT_HASH
65+
rm src/smclarify/COMMIT_HASH
6666
}
6767

6868
install_package(){

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
with open("README.md", "r") as f:
3030
LONG_DESCRIPTION = f.read()
3131

32-
data_files = ["COMMIT_HASH"] if os.path.exists("./COMMIT_HASH") else []
32+
data_files = ["COMMIT_HASH"] if os.path.exists("./src/smclarify/COMMIT_HASH") else []
3333

3434
setup(
3535
name="smclarify",
3636
version="0.1",
3737
packages=find_packages("src"),
3838
package_dir={"": "src"},
39-
data_files=[("", data_files)],
39+
package_data={"smclarify": data_files},
4040
long_description=LONG_DESCRIPTION,
4141
long_description_content_type="text/markdown",
4242
install_requires=INSTALL_REQUIRES,

0 commit comments

Comments
 (0)