From 2147c6043a9ded94bd953d0e0a816a435154bfed Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Mon, 24 Mar 2025 12:20:19 -0700 Subject: [PATCH 1/6] build: Cherry-pick version-bump to 0.9.3? It seems like https://github.com/facebookresearch/fastText has no `0.9.3` commit, even though the latest release on https://pypi.org/project/fasttext/ is on that version... I manually downloaded 0.9.2 and 0.9.3 from PyPI and checked that this was the only diff... --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index deb71a2de..e71ff2e3e 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import platform import io -__version__ = "0.9.2" +__version__ = "0.9.3" FASTTEXT_SRC = "src" # Based on https://github.com/pybind/python_example From d3f4c951ad884a42cdb105f473fa6108c3593d27 Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Mon, 24 Mar 2025 13:13:30 -0700 Subject: [PATCH 2/6] build: Fix `description-file:` metadata In `setuptools==78.0.1`, they started enforcing that no dependencies specify this legacy field (https://github.com/pypa/setuptools/pull/4870). They ended up reverting in https://github.com/pypa/setuptools/pull/4911, but presumably they'll turn this behavior back on in the future... --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index b88034e41..08aedd7e6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ [metadata] -description-file = README.md +description_file = README.md From b5b1943de06cbebc876f204ff7d28a732e040c1a Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Sun, 30 Mar 2025 11:48:00 -0700 Subject: [PATCH 3/6] [TODO] build: Bump to v0.9.4 TODO: Once we're satisfied with testing, remove the `.rc0` suffix! --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e71ff2e3e..70cf11693 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import platform import io -__version__ = "0.9.3" +__version__ = "0.9.4.rc0" FASTTEXT_SRC = "src" # Based on https://github.com/pybind/python_example From 4c1a1db0b3a994a231b9a25dedc735756e6f6b70 Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Mon, 24 Mar 2025 13:15:39 -0700 Subject: [PATCH 4/6] ci: Build and upload wheel to `s3://everlaw-build-artifacts` --- .github/workflows/build_wheel.yml | 36 +++++++++++++++++++++++++++++++ setup.py | 1 + upload-wheel.sh | 14 ++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 .github/workflows/build_wheel.yml create mode 100755 upload-wheel.sh diff --git a/.github/workflows/build_wheel.yml b/.github/workflows/build_wheel.yml new file mode 100644 index 000000000..e7b62b245 --- /dev/null +++ b/.github/workflows/build_wheel.yml @@ -0,0 +1,36 @@ +name: build_wheel +on: [push] +permissions: read-all +jobs: + build_wheel: + strategy: + matrix: + python-version: + - 3.12.6 + runs-on: [self-hosted, fasttext] + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 + - name: Install Python + run: | + uv python install ${{ matrix.python-version }} + - name: Create virtual environment + run: | + rm -rf venv + uv venv --python ${{ matrix.python-version }} venv + echo "$(pwd)/venv/bin" >> $GITHUB_PATH + - name: Build wheel + run: | + rm -rf dist + uv build --out-dir dist + - name: Check wheel + run: | + # These requirements were lifted from `install_requires` in `setup.py`. + uv pip install \ + 'pybind11>=2.2' \ + 'setuptools>=0.7.0' \ + 'numpy' + uv pip install --no-index --find-links dist fasttext + python -c 'import fasttext' + - name: Upload wheel + run: | + ./upload-wheel.sh dist/fasttext*.whl diff --git a/setup.py b/setup.py index 70cf11693..976bdfe41 100644 --- a/setup.py +++ b/setup.py @@ -194,6 +194,7 @@ def _get_readme(): "Operating System :: Unix", "Operating System :: MacOS", ], + # These requirements are duplicated in `.github/workflows/build_wheel.yml`. install_requires=["pybind11>=2.2", "setuptools >= 0.7.0", "numpy"], cmdclass={"build_ext": BuildExt}, packages=[ diff --git a/upload-wheel.sh b/upload-wheel.sh new file mode 100755 index 000000000..9bf12aca4 --- /dev/null +++ b/upload-wheel.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euo pipefail + +wheel="$1" +url="s3://everlaw-build-artifacts/fasttext/$(basename "$wheel")" + +if aws s3 ls "$url" &>/dev/null; then + >&2 echo "$url already exists!" + exit 0 +fi + +aws s3 cp --only-show-errors "$wheel" "$url" +>&2 echo "Uploaded $url" From de9faa0b62028b856d0a7ff56a22cc57ac8cbcc9 Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Mon, 24 Mar 2025 13:16:06 -0700 Subject: [PATCH 5/6] ci: Configure Renovate for this repo --- .github/renovate.json5 | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/renovate.json5 diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 000000000..10815770b --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended", + "schedule:weekly" + ], + "timezone": "America/Los_Angeles", + "includePaths": [".github/**"] +} From 6f9fdc6040795c5611a0d64ca1180b4448930a51 Mon Sep 17 00:00:00 2001 From: Kevin Murphy Date: Thu, 3 Apr 2025 11:58:23 -0700 Subject: [PATCH 6/6] dev: Add a basic `CODEOWNERS` Currently, we have Renovate configured to open PRs against this repo, but nobody is actually ever reviewing them... In the future, it would be nice to designate some other group of people to review the "code" here, but we need *some* catch-all for now. --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 000000000..e09d90c5e --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners +* @Everlaw/developer-experience-squad