Skip to content

Commit

Permalink
Update build paths for python library
Browse files Browse the repository at this point in the history
Signed-off-by: Mattt Zmuda <mattt@replicate.com>
  • Loading branch information
mattt committed Jun 5, 2023
1 parent 68b8d6a commit 4478561
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ jobs:
id: build-python-package
run: |
# clean package built for go client
rm -rf python/dist
rm -rf dist
# install build
pip install build
# build package
python -m build python/ --wheel
python -m build --wheel
# set output
echo "version=$(ls python/dist/ | cut -d- -f2)" >> $GITHUB_OUTPUT
echo "version=$(ls dist/ | cut -d- -f2)" >> $GITHUB_OUTPUT
- name: Push Python package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: python/dist
packages_dir: dist
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ __pycache__
dist
*.egg-info
pkg/dockerfile/embed/cog.whl
python/build
build/
dist/
# Used by a vim plugin (projectionist)
.projections.json
.venv/
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ all: cog

pkg/dockerfile/embed/cog.whl: python/* python/cog/* python/cog/server/* python/cog/command/*
@echo "Building Python library"
rm -rf python/dist
$(PYTHON) -m pip install build && $(PYTHON) -m build python/ --wheel
rm -rf dist
$(PYTHON) -m pip install build && $(PYTHON) -m build --wheel
mkdir -p pkg/dockerfile/embed
cp python/dist/*.whl $@
cp dist/*.whl $@

.PHONY: cog
cog: pkg/dockerfile/embed/cog.whl
Expand All @@ -46,7 +46,7 @@ uninstall:
.PHONY: clean
clean:
$(GO) clean
rm -rf python/build python/dist
rm -rf build dist
rm -f cog
rm -f pkg/dockerfile/embed/cog.whl

Expand Down

0 comments on commit 4478561

Please sign in to comment.