Skip to content
Closed
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
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v4
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Publish package distributions to PyPI
run: pdm publish
run: |
uv build
uv publish --trusted-publishing automatic

- name: Generate Changelog
id: changelog
Expand Down
28 changes: 12 additions & 16 deletions .github/workflows/test_and_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,34 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: setup pdm
uses: pdm-project/setup-pdm@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}

- name: install pdm and dependencies
- name: install uv and dependencies
if: matrix.os != 'macos-14'
run: |
pdm lock --group dev --group lsp --group mcp
pdm install
run: uv sync -U --group dev --group lsp --group mcp --no-group legacy -p ${{ matrix.python-version }}

- name: install pdm and dependencies for legacy system
if: matrix.os == 'macos-14'
run: |
pdm lock --group dev --group lsp --group mcp --group legacy
pdm install
run: uv sync -U --group dev --group lsp --group mcp --group legacy -p ${{ matrix.python-version }}

- name: Set custom HF cache directory
run: |
export HF_HOME="$GITHUB_WORKSPACE/hf_cache"
export SENTENCE_TRANSFORMERS_HOME=$HF_HOME
mkdir -p $HF_HOME
[ -z "$(ls $HF_HOME)" ] || rm $HF_HOME/* -rf && true
export SENTENCE_TRANSFORMERS_HOME="$HF_HOME"
mkdir -p "$HF_HOME"
[ -z "$(ls $HF_HOME)" ] || rm "${HF_HOME:?}"/* -rf && true

- name: run tests
run: pdm run pytest --enable-coredumpy --coredumpy-dir ${{ env.COREDUMPY_DUMP_DIR }}
run: uv run pytest --enable-coredumpy --coredumpy-dir ${{ env.COREDUMPY_DUMP_DIR }}

- name: run coverage
run: |
pdm run coverage run -m pytest
pdm run coverage report -m
pdm run coverage xml -i
uv run coverage run -m pytest
uv run coverage report -m
uv run coverage xml -i

- name: upload coverage reports to codecov
uses: codecov/codecov-action@v5
Expand Down
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
.PHONY: multitest

deps:
pdm lock --group dev --group lsp --group mcp; \
pdm install
uv sync --group dev --group lsp --group mcp

test:
make deps; \
pdm run pytest --enable-coredumpy --coredumpy-dir dumps
uv run pytest --enable-coredumpy --coredumpy-dir dumps

multitest:
@for i in {11..13}; do \
pdm use python3.$$i; \
make test; \
uv venv -p python3.$$i; \
make test || exit 1; \
done

coverage:
make deps; \
pdm run coverage run -m pytest; \
pdm run coverage html; \
pdm run coverage report -m
uv run coverage run -m pytest; \
uv run coverage html; \
uv run coverage report -m; \
uv run coverage xml -m
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ for a list of hooks enabled for the repo.
# Python CLI

The development and publication of this tool is managed by
[pdm](https://pdm-project.org/en/latest/).
[uv](https://docs.astral.sh/uv/).

Once you've cloned and `cd`ed into the repo, run `make deps`. This will call
some `pdm` commands to install development dependencies. Some of them are
some `uv` commands to install development dependencies. Some of them are
actually optional, but for convenience I decided to leave them here. This will
include [pytest](https://docs.pytest.org/en/stable/), the testing framework,
and [coverage.py](https://coverage.readthedocs.io/en/7.7.1/), the coverage
Expand Down
15 changes: 4 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,11 @@ vectorcode-server = "vectorcode.lsp_main:main"
vectorcode-mcp-server = "vectorcode.mcp_main:main"

[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[tool.pdm]
distribution = true

[tool.pdm.version]
source = "scm"
write_to = "./vectorcode/_version.py"
write_template = "__version__ = '{}' # pragma: no cover"
[tool.setuptools_scm]
version_file = "./src/vectorcode/_version.py"

[tool.coverage.run]
omit = [
Expand All @@ -69,8 +64,6 @@ dev = [
"debugpy>=1.8.12",
"coredumpy>=0.4.1",
]

[project.optional-dependencies]
legacy = ["numpy<2.0.0", "torch==2.2.2", "transformers<=4.49.0"]
intel = ['optimum[openvino]', 'openvino']
lsp = ['pygls<2.0.0', 'lsprotocol']
Expand Down
Loading