Skip to content

Commit

Permalink
Replace "python setup.py" builds with "python -m build"
Browse files Browse the repository at this point in the history
Found left-over remnants of `setup.py` install and updated with current
build method using `build` package.

Not sure how `Makefile` and `release.py` had access to `twine`
previously since it was neither installed within nor part of
`Pipfile`'s `[dev-packages]`. So, updated `Pipfile` with both `build`
and `twine`.

**`Pipfile.lock` has not been updated.**
  • Loading branch information
kalebmckale committed Aug 28, 2023
1 parent 00de64d commit f64ca3f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pypi_upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ jobs:

- name: Install dependencies
run: |
python -m pip install --upgrade --upgrade-strategy=eager pip setuptools wheel twine
python -m pip install --upgrade --upgrade-strategy=eager pip setuptools build wheel twine
python -m pip install -e . --upgrade
python -m pipenv install --dev
env:
PIPENV_DEFAULT_PYTHON_VERSION: "3.10"

- name: Build wheels
run: |
python -m pipenv run python setup.py sdist bdist_wheel
python -m pipenv run python -m build
# to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
- name: Publish a Python distribution to PyPI
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ venv_dir := $(get_venv_dir)/pipenv_venv
venv_file := $(CURDIR)/.test_venv
get_venv_path =$(file < $(venv_file))
# This is how we will build tag-specific wheels, e.g. py36 or py37
PY_VERSIONS:= 3.7 3.8 3.9 3.10
PY_VERSIONS:= 3.7 3.8 3.9 3.10 3.11
BACKSLASH = '\\'
# This is how we will build generic wheels, e.g. py2 or py3
INSTALL_TARGETS := $(addprefix install-py,$(PY_VERSIONS))
Expand Down Expand Up @@ -96,7 +96,7 @@ retest: virtualenv submodules test-install

.PHONY: build
build: install-virtualenvs.stamp install.stamp
PIPENV_PYTHON=3.7 pipenv run python setup.py sdist bdist_wheel
PIPENV_PYTHON=3.7 pipenv run python -m build

.PHONY: update-version
update-version:
Expand Down
2 changes: 2 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ invoke = "==2.0.0"
exceptiongroup = "==1.1.0"
tomli = "*"
pyyaml = "==6.0.1"
twine = "*"
build = "*"

[packages]
pytz = "*"
Expand Down
2 changes: 1 addition & 1 deletion tasks/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def build_dists(ctx):
ctx.run("pipenv install --dev", env=env)
ctx.run("pipenv run pip install -e . --upgrade --upgrade-strategy=eager", env=env)
log("Building wheel using python %s ...." % py_version)
ctx.run("pipenv run python setup.py sdist bdist_wheel", env=env)
ctx.run("pipenv run python -m build", env=env)


@invoke.task(build_dists)
Expand Down

0 comments on commit f64ca3f

Please sign in to comment.