Skip to content
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
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ You can also get additional information at
[these instructions](https://www.pythoncheatsheet.org/blog/python-projects-with-poetry-and-vscode-part-1)
for getting setup in VSCode with linting and formatting enabled.

## Building the distribution files

From the project root, run:

python build_distributions.py

This creates the wheel, source distribution, and standalone SPDX SBOM in `dist/`. To write them to a different directory,
pass it with `--output`:

python build_distributions.py --output <directory>

## Running the tests

Before running any tests, first deploy the test application:
Expand Down
36 changes: 36 additions & 0 deletions build_distributions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright (c) 2023-2026 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.

import argparse
import shutil
import subprocess
from pathlib import Path


PROJECT_DIR = Path(__file__).resolve().parent


def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--output", type=Path, default=PROJECT_DIR / "dist")
args = parser.parse_args()
output_dir = args.output.resolve()

version = subprocess.run(
["poetry", "version", "--short"],
cwd=PROJECT_DIR,
check=True,
capture_output=True,
text=True,
).stdout.strip()
subprocess.run(
["poetry", "build", "--output", str(output_dir)],
cwd=PROJECT_DIR,
check=True,
)
sbom_name = f"marklogic_python_client-{version}.spdx.json"
shutil.copyfile(PROJECT_DIR / "sbom.spdx.json", output_dir / sbom_name)
print(f"Copy file {sbom_name}")


if __name__ == "__main__":
main()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description = "Python client for MarkLogic, built on the requests library"
authors = ["MarkLogic <[email protected]>"]
readme = "README.md"
packages = [{include = "marklogic"}]
include = [{ path = "sbom.spdx.json", format = ["sdist", "wheel"] }]
license = "Apache 2.0"

[tool.poetry.dependencies]
Expand Down
Loading
Loading