Skip to content

Commit

Permalink
feat: add pypi sdist (#298)
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <kemingy94@gmail.com>
  • Loading branch information
kemingy committed Jun 13, 2022
1 parent cfe65fe commit 452f3dc
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
ls bin/
python -m pip install --upgrade pip
python -m pip install twine wheel auditwheel setuptools_scm
python setup.py bdist_wheel
python setup.py bdist_wheel sdist
auditwheel repair dist/*.whl
ls wheelhouse/
pushd wheelhouse
Expand Down
7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
include LICENSE
include README.md
include Makefile
include .goreleaser.yaml .goreleaser/*.Dockerfile
include pkg/* cmd/*
include go.mod go.sum
prune examples
prune docs
prune .github
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ REGISTRY ?= ghcr.io/tensorchord
# Container registry for base images.
BASE_REGISTRY ?= docker.io

# Enable CGO by default.
CGO_ENABLED ?= 1
# Disable CGO by default.
CGO_ENABLED ?= 0

#
# These variables should not need tweaking.
Expand Down Expand Up @@ -95,7 +95,7 @@ export GOFLAGS ?= -count=1
#

# All targets.
.PHONY: lint test build container push addlicense debug debug-local build-local generate clean test-local addlicense-install mockgen-install
.PHONY: lint test build container push addlicense debug debug-local build-local generate clean test-local addlicense-install mockgen-install pypi-build

build: build-local

Expand All @@ -121,6 +121,9 @@ build-local:
$(CMD_DIR)/$${target}; \
done

pypi-build: clean
@python setup.py sdist bdist_wheel

generate: mockgen-install
@mockgen -source pkg/buildkitd/buildkitd.go -destination pkg/buildkitd/mock/mock.go -package mock
@mockgen -source pkg/lang/frontend/starlark/interpreter.go -destination pkg/lang/frontend/starlark/mock/mock.go -package mock
Expand Down Expand Up @@ -148,6 +151,7 @@ test: generate
clean:
@-rm -vrf ${OUTPUT_DIR}
@-rm -vrf ${DEBUG_DIR}
@-rm -vrf build dist .eggs *.egg-info

fmt: ## Run go fmt against code.
go fmt ./...
Expand Down
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
readme = f.read()


def build_envd_if_not_found():
if not os.path.exists("bin/envd"):
logging.info("envd not found. Build from scratch")
def build_envd_if_not_found():
if not os.path.exists("bin/envd"):
logging.info("envd not found. Build from scratch")
errno = subprocess.call(["make", "build"])
assert errno == 0, "Failed to build envd"


class EnvdExtension(Extension):
"""Extension for `envd`"""

Expand Down Expand Up @@ -57,10 +58,10 @@ def get_version():
setup(
name="envd",
version=get_version(),
use_scm_version = True,
setup_requires=['setuptools_scm'],
use_scm_version=True,
setup_requires=["setuptools_scm"],
description="A development environment management tool for data scientists.",
long_description=readme,
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/tensorchord/envd",
license="Apache License 2.0",
Expand Down

0 comments on commit 452f3dc

Please sign in to comment.