Skip to content

Commit 7817a11

Browse files
Update Makefile build/upload rules
- add build-sdist and include in build target - add upload-sdiest and include in upload - remove anaconda-upload
1 parent 0fb99b5 commit 7817a11

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

Makefile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ PACKAGE := mkdocstrings-python-xref
2727
PACKAGE_VERSION_PATH := src/mkdocstrings_handlers/python_xref/VERSION
2828
VERSION := $(strip $(file < $(PACKAGE_VERSION_PATH)))
2929

30-
SRC_FILES := $(wildcard src/mkdocstrings_handlers/garpy_python/*.py) $(PYTHON_VERSION_PATH)
30+
SRC_FILES := $(wildcard src/mkdocstrings_handlers/python_xref/*.py) $(PYTHON_VERSION_PATH)
3131

3232
# Env names
3333
DEV_ENV := mkxref-dev
@@ -145,17 +145,20 @@ lint: pylint mypy
145145
WHEEL_FILE := dist/$(subst -,_,$(PACKAGE))-$(VERSION)-py3-none-any.whl
146146
CONDA_FILE := dist/$(PACKAGE)-$(VERSION)-py_0.conda
147147

148+
build-sdist:
149+
$(CONDA_RUN) python -m build --sdist --no-isolation --outdir dist
150+
148151
$(WHEEL_FILE):
149152
$(CONDA_RUN) pip wheel . --no-deps --no-build-isolation -w dist
150153

151154
build-wheel: $(WHEEL_FILE)
152155

153156
$(CONDA_FILE): $(WHEEL_FILE)
154-
$(CONDA_RUN) whl2conda build $(WHEEL_FILE)
157+
$(CONDA_RUN) whl2conda convert $(WHEEL_FILE)
155158

156159
build-conda: $(CONDA_FILE)
157160

158-
build: build-wheel
161+
build: build-wheel build-sdist build-conda
159162

160163
site/index.html: $(MKDOC_FILES) $(SRC_FILES)
161164
$(CONDA_RUN) mkdocs build -f $(MKDOC_CONFIG)
@@ -193,16 +196,24 @@ doc-serve-all:
193196

194197
mike-serve: doc-serve-all
195198

196-
check-upload:
197-
$(CONDA_RUN) twine check $(WHEEL_FILE)
199+
check-upload-wheel:
200+
$(CONDA_RUN) twine check dist/*.whl
201+
202+
check-upload-sdist:
203+
$(CONDA_RUN) twine check dist/*.tar.gz
204+
205+
check-upload: check-upload-sdist check-upload-wheel
206+
207+
upload-wheel: check-upload-wheel
208+
# NOTE: --skip-existing doesn't seem to actually work
209+
$(CONDA_RUN) twine upload --skip-existing $(lastword $(sort $(wildcard dist/*.whl)))
210+
198211

199-
upload: check-upload
212+
upload-sdist: check-upload-sdist
200213
# NOTE: --skip-existing doesn't seem to actually work
201-
$(CONDA_RUN) twine upload --skip-existing $(WHEEL_FILE)
214+
$(CONDA_RUN) twine upload --skip-existing $(lastword $(sort $(wildcard dist/*.tar.gz)))
202215

203-
anaconda-upload: $(CONDA_FILE)
204-
# you will need to log in first
205-
anaconda upload --user garpy $(CONDA_FILE)
216+
upload: upload-sdist upload-wheel
206217

207218
clean-build:
208219
-@$(RMDIR) build

0 commit comments

Comments
 (0)