Skip to content

Commit e3262ce

Browse files
cclaussderonnaxamweissdimbleby
authored
Running setup.py directly is deprecated (celery#737)
* Running setup.py directly is deprecated * Makefile * Apply suggestions from code review Co-authored-by: Mathieu Dupuy <[email protected]> * Update Makefile Co-authored-by: Adam Weiss <[email protected]> * Update docker/base/Dockerfile Co-authored-by: Adam Weiss <[email protected]> * Dockerfile: RUN pip3 install --user --editable ".[develop]" Co-authored-by: Mathieu Dupuy <[email protected]> * docker-compose.yml: tags: - django-celery-beat_base:latest * python -m pip install --upgrade build twine Co-authored-by: David Hotham <[email protected]> --------- Co-authored-by: Mathieu Dupuy <[email protected]> Co-authored-by: Adam Weiss <[email protected]> Co-authored-by: David Hotham <[email protected]>
1 parent a50011d commit e3262ce

File tree

6 files changed

+30
-19
lines changed

6 files changed

+30
-19
lines changed

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ help:
4545
@echo " clean ------------ - Non-destructive clean"
4646
@echo " clean-pyc - Remove .pyc/__pycache__ files"
4747
@echo " clean-docs - Remove documentation build artifacts."
48-
@echo " clean-build - Remove setup artifacts."
48+
@echo " clean-build - Remove build artifacts."
4949
@echo "bump - Bump patch version number."
5050
@echo "bump-minor - Bump minor version number."
5151
@echo "bump-major - Bump major version number."
@@ -65,7 +65,9 @@ bump-major:
6565
bumpversion major
6666

6767
release:
68-
python setup.py register sdist bdist_wheel upload --sign --identity="$(PGPIDENT)"
68+
python -m pip install --upgrade build twine
69+
python -m build
70+
twine upload --sign --identity="$(PGPIDENT) dist/*"
6971

7072
Documentation:
7173
(cd "$(SPHINX_DIR)"; $(MAKE) html)
@@ -145,7 +147,7 @@ cov:
145147
(cd $(TESTDIR); $(PYTEST) -x --cov="$(PROJ)" --cov-report=html)
146148

147149
build:
148-
$(PYTHON) setup.py sdist bdist_wheel
150+
$(PYTHON) -m build
149151

150152
distcheck: lint test clean
151153

README.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ To install using ``pip``:
252252

253253
.. code-block:: bash
254254
255-
$ pip install -U django-celery-beat
255+
$ pip install --upgrade django-celery-beat
256256
257257
Downloading and installing from source
258258
--------------------------------------
@@ -264,14 +264,13 @@ You can install it by doing the following :
264264

265265
.. code-block:: bash
266266
267+
$ python3 -m venv .venv
268+
$ source .venv/bin/activate
269+
$ pip install --upgrade build pip
267270
$ tar xvfz django-celery-beat-0.0.0.tar.gz
268271
$ cd django-celery-beat-0.0.0
269-
$ python setup.py build
270-
# python setup.py install
271-
272-
The last command must be executed as a privileged user if
273-
you are not currently using a virtualenv.
274-
272+
$ python -m build
273+
$ pip install --upgrade .
275274
276275
After installation, add ``django_celery_beat`` to Django's settings module:
277276

docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ services:
88
build:
99
context: .
1010
dockerfile: docker/base/Dockerfile
11+
tags:
12+
- django-celery-beat_base:latest
1113
command: ["sleep", "inf"]
1214

1315
django:

docker/base/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN apt-get update && apt-get install --yes --no-install-recommends \
99
wait-for-it
1010

1111
RUN pip3 install --user \
12+
build \
1213
django-createsuperuserwithpassword \
1314
psycopg2-binary
1415

@@ -19,8 +20,7 @@ COPY requirements/ /app/requirements/
1920

2021
WORKDIR /app
2122

22-
RUN python3 setup.py develop --user
23-
23+
RUN pip3 install --user --editable ".[develop]"
2424

2525
WORKDIR /
2626

docs/includes/installation.txt

+14-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ or from source.
66

77
To install using `pip`,::
88

9-
$ pip install -U django-celery-beat
9+
$ pip install --upgrade django-celery-beat
10+
11+
Installing the current default branch
12+
-------------------------------------
13+
14+
$ python3 -m venv .venv
15+
$ source .venv/bin/activate
16+
$ pip install --upgrade pip
17+
$ pip install git+https://github.com/celery/django-celery-beat.git
1018

1119
Downloading and installing from source
1220
--------------------------------------
@@ -16,13 +24,13 @@ http://pypi.python.org/pypi/django-celery-beat
1624

1725
You can install it by doing the following,::
1826

27+
$ python3 -m venv .venv
28+
$ source .venv/bin/activate
29+
$ pip install --upgrade build pip
1930
$ tar xvfz django-celery-beat-0.0.0.tar.gz
2031
$ cd django-celery-beat-0.0.0
21-
$ python setup.py build
22-
# python setup.py install
23-
24-
The last command must be executed as a privileged user if
25-
you are not currently using a virtualenv.
32+
$ python -m build
33+
$ pip install .
2634

2735
Using the development version
2836
-----------------------------

t/unit/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import pytest
44
# we have to import the pytest plugin fixtures here,
5-
# in case user did not do the `python setup.py develop` yet,
5+
# in case user did not yet `pip install ".[develop]"`,
66
# that installs the pytest plugin into the setuptools registry.
77
from celery.contrib.pytest import (celery_app, celery_config,
88
celery_enable_logging, celery_parameters,

0 commit comments

Comments
 (0)