Skip to content

feat: Keep all components aligned on the same version at any commit. - #866

Merged
sscargal merged 2 commits into
mainfrom
830
Jan 9, 2026
Merged

sscargal merged 2 commits into
mainfrom
830

Conversation

@tianAndrew

@tianAndrew tianAndrew commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor

Purpose of the change

Use setuptools-scm to automatically derive version numbers from Git tags.

Fixes/Closes

Fixes #830

Type of change

[Please delete options that are not relevant.]

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

[Please delete options that are not relevant.]

  • Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Test Results: [Attach logs, screenshots, or relevant output]

(base) andrew@andrewdeMBP MemMachine % uv build --project packages/meta
...
Successfully built dist/memmachine_meta-0.2.2.dev34+gb0090cf1e.tar.gz
Successfully built dist/memmachine_meta-0.2.2.dev34+gb0090cf1e-py3-none-any.whl

(base) andrew@andrewdeMBP MemMachine % uv build --project packages/server
...
Successfully built dist/memmachine_server-0.2.2.dev34+gb0090cf1e.tar.gz
Successfully built dist/memmachine_server-0.2.2.dev34+gb0090cf1e-py3-none-any.whl

(base) andrew@andrewdeMBP MemMachine % uv build --project packages/client 
...

Successfully built dist/memmachine_client-0.2.2.dev34+gb0090cf1e.tar.gz
Successfully built dist/memmachine_client-0.2.2.dev34+gb0090cf1e-py3-none-any.whl

Checklist

[Please delete options that are not relevant.]

  • I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Screenshots/Gifs

[If applicable, add screenshots or GIFs that show the changes in action. This is especially helpful for API responses. Otherwise, delete this section or type "N/A".]

Further comments

[Add any other relevant information here, such as potential side effects, future considerations, or any specific questions for the reviewer. Otherwise, type "None".]

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces automatic versioning using setuptools-scm to synchronize all package versions based on Git tags, eliminating the need for manual version management across multiple packages.

  • Replaced hardcoded versions with dynamic versioning via setuptools-scm
  • Removed manual version patching logic from CI/CD workflows
  • Updated meta-package dependencies to remove pinned version constraints

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Migrated from uv_build to setuptools and enabled dynamic versioning with setuptools-scm
packages/server/pyproject.toml Added setuptools-scm dependency and configured root path for version detection
packages/meta/pyproject.toml Removed pinned version constraints on client/server dependencies and enabled dynamic versioning
packages/client/pyproject.toml Added setuptools-scm dependency and configured root path for version detection
.github/workflows/pypi-publish.yml Removed patch-version parameter that is no longer needed
.github/workflows/build-python.yml Removed version patching logic and added full Git history fetch for SCM versioning

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/meta/pyproject.toml
Comment thread pyproject.toml Outdated
@tianAndrew

tianAndrew commented Dec 24, 2025 •

Copy link
Copy Markdown
Contributor Author

Met a random test failure in CI:

FAILED tests/memmachine/semantic_memory/test_semantic_memory_background.py::test_multiple_sets_processed_independently[in_memory_semantic_storage-count_cache_episode_storage-sqlalchemy_sqlite_engine] - KeyError: 4

@sscargal sscargal left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tianAndrew - Thank you for taking this on. Can we find a solution that doesn't require switching build tools from uv to setuptools?

Comment thread pyproject.toml Outdated
Comment thread pyproject.toml Outdated
@tianAndrew
tianAndrew force-pushed the 830 branch 3 times, most recently from 77515f7 to 71473f1 Compare December 26, 2025 02:06
@tianAndrew tianAndrew self-assigned this Dec 30, 2025
@jealous

jealous commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

@tianAndrew , is there any response to Steve's comments?

@sscargal

sscargal commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

@tianAndrew This is a great addition, thank you.

During testing, I confirmed that the uv build --project packages/[meta|server|client] works as advertised. However, existing build methods need to be updated to use the new SCM version. ie:

  • build-docker.sh
  • Dockerfile
  • .github/workflows/docker-image.yml
  • memmachine-compose.sh build

Patch

Here is the patch including my proposed changes.

scm_versioning_fix.patch

You should be able to add these to your branch (this PR) using:

git am scm_versioning_fix.patch

With the changes, the existing build methods work

memmachine-compose.sh build

We will build a production version when the user selects the latest tag. If they decline, we now show them the SCM version as the default option, but allow them to manually enter a tag string.

$ ./memmachine-compose.sh build
[INFO] No name specified.
[INFO] Using default name: memmachine/memmachine:latest
[PROMPT] Building memmachine/memmachine:latest with '--build-arg GPU=[true|false]' (default: false): 
[INFO] Building memmachine/memmachine:latest with GPU=false (SCM_VERSION: 0.2.2.dev15+g799a6563)
[+] Building 12.8s (22/22) FINISHED                                                                                                                                                                                                                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 2.15kB                                                                                                                                                                                                                                                                            0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:latest                                                                                                                                                                                                                                                      0.4s
 => [internal] load metadata for docker.io/library/python:3.12-slim-trixie                                                                                                                                                                                                                                        0.2s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                 0.0s
 => => transferring context: 1.29kB                                                                                                                                                                                                                                                                               0.0s
 => [builder  1/12] FROM docker.io/library/python:3.12-slim-trixie@sha256:a75662dfec8d90bd7161c91050be2e0a9b21d284f3b7a7253d5db25f7d583fb3                                                                                                                                                                        0.0s
 => FROM ghcr.io/astral-sh/uv:latest@sha256:2320e6c239737dc73cccce393a8bb89eba2383d17018ee91a59773df802c20e6                                                                                                                                                                                                      0.0s
 => [internal] load build context                                                                                                                                                                                                                                                                                 0.5s
 => => transferring context: 1.59MB                                                                                                                                                                                                                                                                               0.5s
 => CACHED [builder  2/12] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y curl &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*                                                                                                                                                    0.0s
 => CACHED [builder  3/12] RUN python -m pip install --upgrade pip                                                                                                                                                                                                                                                0.0s
 => CACHED [final 4/6] WORKDIR /app                                                                                                                                                                                                                                                                               0.0s
 => CACHED [builder  4/12] COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/                                                                                                                                                                                                                       0.0s
 => CACHED [builder  5/12] WORKDIR /app                                                                                                                                                                                                                                                                           0.0s
 => CACHED [builder  6/12] COPY pyproject.toml uv.lock ./                                                                                                                                                                                                                                                         0.0s
 => CACHED [builder  7/12] COPY packages/ packages/                                                                                                                                                                                                                                                               0.0s
 => CACHED [builder  8/12] COPY src/ src/                                                                                                                                                                                                                                                                         0.0s
 => CACHED [builder  9/12] COPY README.md README.md                                                                                                                                                                                                                                                               0.0s
 => [builder 10/12] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then     uv sync --locked --no-install-project --no-editable --no-dev --extra gpu;     else     uv sync --locked --no-install-project --no-editable --no-dev;     fi                                               2.0s
 => [builder 11/12] COPY . /app                                                                                                                                                                                                                                                                                   2.2s 
 => [builder 12/12] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then     uv sync --locked --no-editable --no-dev --extra gpu;     else     uv sync --locked --no-editable --no-dev;     fi                                                                                         1.1s 
 => [final 5/6] COPY --from=builder /app/.venv /app/.venv                                                                                                                                                                                                                                                         2.0s 
 => [final 6/6] RUN python -c "import nltk, sys;     passed = nltk.download('punkt_tab') and nltk.download('stopwords');     sys.exit(0 if passed else 1)"                                                                                                                                                        1.1s 
 => exporting to image                                                                                                                                                                                                                                                                                            1.0s 
 => => exporting layers                                                                                                                                                                                                                                                                                           1.0s 
 => => writing image sha256:196b1f44b519c037ee0c3dd8b32753c283c6c73f867ad1e83a6b43bd6ff23a2c                                                                                                                                                                                                                      0.0s 
 => => naming to docker.io/memmachine/memmachine:latest                         

build-docker-sh

$ ./build-docker.sh 
==> Select build options:
Which image type to build? (1: CPU, 2: GPU, 3: Both) [3]: 1
Which architectures? (1: amd64, 2: arm64, 3: Both) [3]: 1
Latest Git tag is 'v0.2.2'. Use this? (Y/n): n
Suggested SCM version is '0.2.2.dev15+g799a6563'. Press Enter to use or enter manual tag: 
==> A 'latest' tag (e.g., 'latest-cpu') acts as a pointer to the newest stable release.
Apply 'latest' tag for this version? (Y/n): 
Select action (1: Build locally, 2: Build and Push, 3: Cancel) [2]: 1
==> Checking for required dependencies...
==> All dependencies are present.
==> Setting up Docker Buildx multi-architecture builder...
Name:          memmachine_builder
Driver:        docker-container
Last Activity: 2026-01-07 23:29:12 +0000 UTC

Nodes:
Name:                  memmachine_builder0
Endpoint:              unix:///var/run/docker.sock
Driver Options:        image="moby/buildkit:v0.12.0"
Status:                running
BuildKit daemon flags: --allow-insecure-entitlement=network.host
BuildKit version:      v0.12.0
Platforms:             linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
Labels:
 org.mobyproject.buildkit.worker.executor:         oci
 org.mobyproject.buildkit.worker.hostname:         016780a00772
 org.mobyproject.buildkit.worker.network:          host
 org.mobyproject.buildkit.worker.oci.process-mode: sandbox
 org.mobyproject.buildkit.worker.selinux.enabled:  false
 org.mobyproject.buildkit.worker.snapshotter:      overlayfs
GC Policy rule#0:
 All:            false
 Filters:        type==source.local,type==exec.cachemount,type==source.git.checkout
 Keep Duration:  48h0m0s
 Reserved Space: 488.3MiB
GC Policy rule#1:
 All:            false
 Keep Duration:  1440h0m0s
 Reserved Space: 11.18GiB
GC Policy rule#2:
 All:            false
 Reserved Space: 11.18GiB
GC Policy rule#3:
 All:            true
 Reserved Space: 11.18GiB
==> Buildx builder is ready.
==> --- BUILD SUMMARY ---
Image Types: 	 CPU 
Version: 		 0.2.2.dev15_g799a6563
Architectures: 	 linux/amd64
Apply 'latest' tags: 	 true
Action: 		 Local Build
---------------------
Continue? (Y/n): 
==> Preparing to build CPU image...
[+] Building 22.1s (24/24) FINISHED                                                                                                                                                                                                                                                docker-container:memmachine_builder
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 2.15kB                                                                                                                                                                                                                                                                            0.0s
 => [internal] load metadata for ghcr.io/astral-sh/uv:latest                                                                                                                                                                                                                                                      0.7s
 => [internal] load metadata for docker.io/library/python:3.12-slim-trixie                                                                                                                                                                                                                                        0.8s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                                                                                                                                                                     0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                 0.0s
 => => transferring context: 1.29kB                                                                                                                                                                                                                                                                               0.0s
 => FROM ghcr.io/astral-sh/uv:latest@sha256:2320e6c239737dc73cccce393a8bb89eba2383d17018ee91a59773df802c20e6                                                                                                                                                                                                      0.0s
 => => resolve ghcr.io/astral-sh/uv:latest@sha256:2320e6c239737dc73cccce393a8bb89eba2383d17018ee91a59773df802c20e6                                                                                                                                                                                                0.0s
 => [internal] load build context                                                                                                                                                                                                                                                                                 0.7s
 => => transferring context: 1.58MB                                                                                                                                                                                                                                                                               0.6s
 => [builder  1/12] FROM docker.io/library/python:3.12-slim-trixie@sha256:a75662dfec8d90bd7161c91050be2e0a9b21d284f3b7a7253d5db25f7d583fb3                                                                                                                                                                        0.0s
 => => resolve docker.io/library/python:3.12-slim-trixie@sha256:a75662dfec8d90bd7161c91050be2e0a9b21d284f3b7a7253d5db25f7d583fb3                                                                                                                                                                                  0.0s
 => CACHED [builder  2/12] RUN apt-get update &&     apt-get upgrade -y &&     apt-get install -y curl &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*                                                                                                                                                    0.0s
 => CACHED [builder  3/12] RUN python -m pip install --upgrade pip                                                                                                                                                                                                                                                0.0s
 => CACHED [builder  4/12] COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/                                                                                                                                                                                                                       0.0s
 => CACHED [builder  5/12] WORKDIR /app                                                                                                                                                                                                                                                                           0.0s
 => CACHED [builder  6/12] COPY pyproject.toml uv.lock ./                                                                                                                                                                                                                                                         0.0s
 => CACHED [builder  7/12] COPY packages/ packages/                                                                                                                                                                                                                                                               0.0s
 => CACHED [builder  8/12] COPY src/ src/                                                                                                                                                                                                                                                                         0.0s
 => CACHED [builder  9/12] COPY README.md README.md                                                                                                                                                                                                                                                               0.0s
 => CACHED [builder 10/12] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then     uv sync --locked --no-install-project --no-editable --no-dev --extra gpu;     else     uv sync --locked --no-install-project --no-editable --no-dev;     fi                                        0.0s
 => [builder 11/12] COPY . /app                                                                                                                                                                                                                                                                                   2.4s
 => [builder 12/12] RUN --mount=type=cache,target=/root/.cache/uv     if [ "false" = "true" ]; then     uv sync --locked --no-editable --no-dev --extra gpu;     else     uv sync --locked --no-editable --no-dev;     fi                                                                                         1.0s
 => CACHED [final 4/6] WORKDIR /app                                                                                                                                                                                                                                                                               0.0s 
 => [final 5/6] COPY --from=builder /app/.venv /app/.venv                                                                                                                                                                                                                                                         1.8s 
 => [final 6/6] RUN python -c "import nltk, sys;     passed = nltk.download('punkt_tab') and nltk.download('stopwords');     sys.exit(0 if passed else 1)"                                                                                                                                                        1.2s 
 => exporting to docker image format                                                                                                                                                                                                                                                                             11.0s 
 => => exporting layers                                                                                                                                                                                                                                                                                           7.3s 
 => => exporting manifest sha256:5d938d8b4bcd70bfa4e13bcb720b83f802aff33869b0c881d4a54a23c7ab9283                                                                                                                                                                                                                 0.0s 
 => => exporting config sha256:f6d8d085c01e5c49dff23fb4fda19833745aabf7962d6647e26112a5ca9c0b67                                                                                                                                                                                                                   0.0s 
 => => sending tarball                                                                                                                                                                                                                                                                                            3.7s
 => importing to docker                                                                                                                                                                                                                                                                                           2.9s
 => => loading layer c54ac8a17c6d 95.83MB / 95.83MB                                                                                                                                                                                                                                                               2.9s
 => => loading layer 292ca3052a32 11.24MB / 11.24MB                                                                                                                                                                                                                                                               0.2s
==> CPU image built successfully!
==> To test it, run: docker run -it --rm memmachine/memmachine:0.2.2.dev15_g799a6563-cpu bash
==> All selected operations are complete.
$ docker image ls
REPOSITORY              TAG                         IMAGE ID       CREATED              SIZE
memmachine/memmachine   0.2.2.dev15_g799a6563-cpu   f6d8d085c01e   About a minute ago   459MB
memmachine/memmachine   latest                      f6d8d085c01e   About a minute ago   459MB
memmachine/memmachine   latest-cpu                  f6d8d085c01e   About a minute ago   459MB

Validation

$ ./memmachine-compose.sh start memmachine/memmachine:0.2.2.dev15_g799a6563-cpu
MemMachine Docker Startup Script
====================================

[SUCCESS] Docker and Docker Compose are available
[SUCCESS] .env file found
[SUCCESS] configuration.yml file found
[SUCCESS] OpenAI API key appears to be configured
[SUCCESS] OPENAI_API_KEY is configured
[SUCCESS] API key in configuration.yml appears to be configured
[SUCCESS] Database credentials in configuration.yml appear to be configured
[INFO] Pulling and starting MemMachine services...
[INFO] Pulling latest images... (Target: memmachine/memmachine:0.2.2.dev15_g799a6563-cpu)
[WARNING] Image 'memmachine/memmachine:0.2.2.dev15_g799a6563-cpu' not found in Docker Hub registry (manifest unknown). Assuming local image.
[+] Running 4/4
 ✔ Network memmachine-network     Created                                                                                                                                                                                                                                                                         0.0s 
 ✔ Container memmachine-neo4j     Healthy                                                                                                                                                                                                                                                                        66.2s 
 ✔ Container memmachine-postgres  Healthy                                                                                                                                                                                                                                                                         5.7s 
 ✔ Container memmachine-app       Started                                                                                                                                                                                                                                                                        66.3s 
[SUCCESS] Services started successfully!
[INFO] Waiting for services to be healthy...
NAME                  IMAGE                                             COMMAND                  SERVICE      CREATED              STATUS                                     PORTS
memmachine-app        memmachine/memmachine:0.2.2.dev15_g799a6563-cpu   "sh -c memmachine-se…"   memmachine   About a minute ago   Up Less than a second (health: starting)   0.0.0.0:8080->8080/tcp, [::]:8080->8080/tcp
memmachine-neo4j      neo4j:5.23-community                              "tini -g -- /startup…"   neo4j        About a minute ago   Up About a minute (healthy)                0.0.0.0:7473-7474->7473-7474/tcp, [::]:7473-7474->7473-7474/tcp, 0.0.0.0:7687->7687/tcp, [::]:7687->7687/tcp
memmachine-postgres   pgvector/pgvector:pg16                            "docker-entrypoint.s…"   postgres     About a minute ago   Up About a minute (healthy)                0.0.0.0:5432->5432/tcp, [::]:5432->5432/tcp
[INFO] Checking service health...
[INFO] Waiting for PostgreSQL to be ready...
/var/run/postgresql:5432 - accepting connections
[SUCCESS] PostgreSQL is ready
[INFO] Waiting for Neo4j to be ready...
[SUCCESS] Neo4j is ready
[INFO] Waiting for MemMachine to be ready...
[SUCCESS] MemMachine is ready
[SUCCESS] 🎉 MemMachine is now running!

Service URLs:
  📊 MemMachine API Docs: http://localhost:8080/docs
  🗄️  Neo4j Browser: http://localhost:7474
  📈 Health Check: http://localhost:8080/api/v2/health
  📊 Metrics: http://localhost:8080/api/v2/metrics

Database Access:
  🐘 PostgreSQL: localhost:5432 (user: memmachine, db: memmachine)
  🔗 Neo4j Bolt: localhost:7687 (user: neo4j)

Useful Commands:
  📋 View logs: docker-compose logs -f
  🛑 Stop services: docker-compose down
  🔄 Restart: docker-compose restart
  🧹 Clean up: docker-compose down -v

@sscargal sscargal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@sscargal
sscargal merged commit 1faa858 into main Jan 9, 2026
48 of 49 checks passed
@sscargal
sscargal deleted the 830 branch January 9, 2026 17:04
o-love pushed a commit that referenced this pull request Jan 23, 2026
…866)

* feat: Keep all components aligned on the same version at any commit.
* fix: resolve SCM versioning and Docker tag compatibility

---------

Co-authored-by: Steve Scargall <[email protected]>
SarahScargall pushed a commit to SarahScargall/MemMachine that referenced this pull request Jan 29, 2026
…emMachine#866)

* feat: Keep all components aligned on the same version at any commit.
* fix: resolve SCM versioning and Docker tag compatibility

---------

Co-authored-by: Steve Scargall <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat]: Keep all components aligned on the same version at any commit

5 participants