Baresquare SDK for Python
Project description
Baresquare Python Libraries
[!CAUTION] This code is published publicly in PyPI - make sure you do not include proprietary information.
This monorepo hosts Baresquare's Python packages, all published to PyPI.
Packages
The repository currently contains the following packages:
- baresquare_core_py: Core utilities shared across Baresquare services
- baresquare_aws_py: AWS-specific utilities that build upon core
Development Guidelines
Versioning
- All packages share the same version number
- Version is defined in each package's
__init__.pyfile (__version__ = "x.y.z") - Git tags must match the version in
__init__.pyfiles (format:vx.y.z) - CI will validate version consistency before publishing
Package Configuration
- A single
pyproject.tomlfile is used for all packages - Package-specific settings are handled in the CI process
- Dependencies between packages are defined in
pyproject.tomlunder[project.optional-dependencies]
Development Setup
To set up the packages for development:
# Install in development mode with all dependencies
pip install -e ".[testing]"
# Run tests
pytest
[!WARNING]
When introducing a new.pyfile, make sure to add it in the appropriate__init__.pyfile, otherwise it will not be makde available in the published package.
Linting
For each directory:
- Show linting issues:
ruff check . --preview - Fix linting issues:
ruff . --fix --preview
Testing
Install packages
# First in the core directory
cd core
pip install -e .
# Then in the aws directory
cd ../aws
pip install -e .[testing]
Then run pytest in each directory
Publishing
[!TIP] Before publishing properly, check the build locally (see instructions below).
With GitHub Action
It is recommended to publish a new version by creating a GitHub release, as this creates release notes in the relevant GitHub page.
Packages are published to PyPI through GitHub Actions when a new tag is pushed:
- Update the
versionfield in allpyproject.tomlfiles (should be the same everywhere) - If there is optional dependency array
publishing, update the core package version there too (e.g. inpyproject.tomlof the AWS package) - Commit changes
- Create and push a tag matching the version (assuming version to be published is 0.1.0):
- via command line:
git tag v0.1.0 && git push origin v0.1.0 - via GitHub UI: Go to "Releases" → "Draft a new release" → "Choose a tag" → Enter "v0.1.0" → "Create new tag"
- via command line:
CI will validate versions, build packages, and publish to PyPI
Manually
You can also use scripts/publish_local.sh:
- Set environment variables:
export TWINE_USERNAME=__token__ export TWINE_PASSWORD=XXX
- If there is optional dependency array
publishing, update the core package version there too (e.g. inpyproject.tomlof the AWS package) - Check
pyproject.tomlfiles of non-core packages - they may reference the version ofbaresquare-core-py - Create a tag locally matching the version
- Run
scripts/publish_local.sh
Check the build
When introducing a new file, ensure the file will be made available in the published package.
cd core
python -m build
mkdir -p wheel_extract
# Extract the wheel (it's just a zip file) - make sure to change the version accordingly
unzip dist/baresquare_core_py-0.1.0-py3-none-any.whl -d wheel_extract
# View the contents
ls -la wheel_extract
# Specifically check for your Python files
find wheel_extract -name "*.py"
then check the file exists in the output.
These instructions are for the core package - adjust accordingly for other packages.
Installation
# Install core package
pip install baresquare_core_py
# Install AWS package (which includes core)
pip install baresquare_aws_py
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baresquare_sdk-0.1.0.tar.gz.
File metadata
- Download URL: baresquare_sdk-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1346159f8504d3534b43568747c2b6c81719ea6f0571141658cd4a14598e3784
|
|
| MD5 |
b8e1e477f54b6b267c4433657647ad39
|
|
| BLAKE2b-256 |
dd2b9ae0e41ecad768d6e75afc0d08b62989eec3a6db480f85e6a76390935642
|
File details
Details for the file baresquare_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: baresquare_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b28e7d62e53c3a53f936ccee842b101153b203da7621dbbb83f76963cc6e9fc3
|
|
| MD5 |
56783142482979b767c480afee62e28c
|
|
| BLAKE2b-256 |
3d8df04c4d0b0ba4b93737b563b764a390b2212fca8506fd286835254d2afcab
|