Skip to content

Commit f45de61

Browse files
authored
PYTHON-4163 Rename src/ to bsonjs/ to avoid setuptools bug that shadows bson package (#53)
1 parent 89893b4 commit f45de61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+22
-19
lines changed

MANIFEST.in

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
include README.rst
22
include CHANGELOG.rst
33
include LICENSE
4-
recursive-include src LICENSE
5-
recursive-include src *.h
6-
recursive-include test *.py
4+
recursive-include bsonjs LICENSE
5+
recursive-include bsonjs *.h
6+
recursive-include bsonjs *.py
77
exclude benchmark.py
88
exclude build-wheels.sh
99
exclude docker-build.sh
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
requires = ["setuptools>=62.0"]
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools]
6+
packages = ["bsonjs"]
7+
58
[project]
69
name = "python-bsonjs"
710
version = "0.3.0"

setup.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
ext_modules=[
2929
Extension(
3030
"bsonjs",
31-
sources=["src/bsonjs.c"] + glob.glob("src/*/*.c"),
32-
include_dirs=["src",
33-
"src/bson",
34-
"src/jsonsl",
35-
"src/common"],
31+
sources=["bsonjs/bsonjs.c"] + glob.glob("bsonjs/*/*.c"),
32+
include_dirs=["bsonjs",
33+
"bsonjs/bson",
34+
"bsonjs/jsonsl",
35+
"bsonjs/common"],
3636
py_limited_api=True,
3737
define_macros=[("BSON_COMPILATION", 1),
3838
("Py_LIMITED_API", "0x03060000")],

vendor.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ python build/calc_release_version.py > VERSION_CURRENT
88
mkdir cmake-build && cd cmake-build
99
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_MONGOC=OFF ..
1010
cd ../../
11-
rm -r python-bsonjs/src/bson
12-
rm -r python-bsonjs/src/jsonsl
13-
rm -r python-bsonjs/src/common
14-
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/src/bson/
15-
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/src/jsonsl/
16-
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/src/jsonsl/
11+
rm -r python-bsonjs/bsonjs/bson
12+
rm -r python-bsonjs/bsonjs/jsonsl
13+
rm -r python-bsonjs/bsonjs/common
14+
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/bsonjs/bson/
15+
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/bsonjs/jsonsl/
16+
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/bsonjs/jsonsl/
1717

18-
rsync -r mongo-c-driver/src/common/*.[hc] python-bsonjs/src/common/
19-
rsync -r mongo-c-driver/cmake-build/src/common/*.[hc] python-bsonjs/src/common/
18+
rsync -r mongo-c-driver/src/common/*.[hc] python-bsonjs/bsonjs/common/
19+
rsync -r mongo-c-driver/cmake-build/src/common/*.[hc] python-bsonjs/bsonjs/common/
2020

21-
rsync -r mongo-c-driver/cmake-build/src/libbson/src/bson/*.[hc] python-bsonjs/src/bson/
21+
rsync -r mongo-c-driver/cmake-build/src/libbson/src/bson/*.[hc] python-bsonjs/bsonjs/bson/
2222

2323
# Ignore autogenerated bson-config.h
2424
cd python-bsonjs/
25-
git diff -- src/bson/bson-config.h | tee
25+
git diff -- bsonjs/bson/bson-config.h | tee
2626
echo "**** Review libbson's autogenerated src/bson/bson-config.h (above) for newly added (or removed) macros ****"
27-
git checkout -- src/bson/bson-config.h
27+
git checkout -- bsonjs/bson/bson-config.h

0 commit comments

Comments
 (0)