Skip to content

Commit

Permalink
PYTHON-4163 Rename src/ to bsonjs/ to avoid setuptools bug that shado…
Browse files Browse the repository at this point in the history
…ws bson package (#53)
  • Loading branch information
ShaneHarvey authored Jan 26, 2024
1 parent 89893b4 commit f45de61
Show file tree
Hide file tree
Showing 72 changed files with 22 additions and 19 deletions.
6 changes: 3 additions & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include README.rst
include CHANGELOG.rst
include LICENSE
recursive-include src LICENSE
recursive-include src *.h
recursive-include test *.py
recursive-include bsonjs LICENSE
recursive-include bsonjs *.h
recursive-include bsonjs *.py
exclude benchmark.py
exclude build-wheels.sh
exclude docker-build.sh
Expand Down
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
requires = ["setuptools>=62.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["bsonjs"]

[project]
name = "python-bsonjs"
version = "0.3.0"
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
ext_modules=[
Extension(
"bsonjs",
sources=["src/bsonjs.c"] + glob.glob("src/*/*.c"),
include_dirs=["src",
"src/bson",
"src/jsonsl",
"src/common"],
sources=["bsonjs/bsonjs.c"] + glob.glob("bsonjs/*/*.c"),
include_dirs=["bsonjs",
"bsonjs/bson",
"bsonjs/jsonsl",
"bsonjs/common"],
py_limited_api=True,
define_macros=[("BSON_COMPILATION", 1),
("Py_LIMITED_API", "0x03060000")],
Expand Down
22 changes: 11 additions & 11 deletions vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ python build/calc_release_version.py > VERSION_CURRENT
mkdir cmake-build && cd cmake-build
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_MONGOC=OFF ..
cd ../../
rm -r python-bsonjs/src/bson
rm -r python-bsonjs/src/jsonsl
rm -r python-bsonjs/src/common
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/src/bson/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/src/jsonsl/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/src/jsonsl/
rm -r python-bsonjs/bsonjs/bson
rm -r python-bsonjs/bsonjs/jsonsl
rm -r python-bsonjs/bsonjs/common
rsync -r mongo-c-driver/src/libbson/src/bson/*.[hc] python-bsonjs/bsonjs/bson/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/*.[hc] python-bsonjs/bsonjs/jsonsl/
rsync -r mongo-c-driver/src/libbson/src/jsonsl/LICENSE python-bsonjs/bsonjs/jsonsl/

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

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

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

0 comments on commit f45de61

Please sign in to comment.