Skip to content

Commit 470d51c

Browse files
authored
improve setup.py (huggingface#4748)
1 parent d614120 commit 470d51c

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

setup.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
For the sources, run: "python setup.py sdist"
4545
You should now have a /dist directory with both .whl and .tar.gz source versions.
4646
47+
Long story cut short, you need to run both before you can upload the distribution to the
48+
test pypi and the actual pypi servers:
49+
50+
python setup.py bdist_wheel && python setup.py sdist
51+
4752
8. Check that everything looks correct by uploading the package to the pypi test server:
4853
4954
twine upload dist/* -r pypitest
@@ -54,14 +59,20 @@
5459
Check that you can install it in a virtualenv by running:
5560
pip install -i https://testpypi.python.org/pypi diffusers
5661
62+
If you are testing from a Colab Notebook, for instance, then do:
63+
pip install diffusers && pip uninstall diffusers
64+
pip install -i https://testpypi.python.org/pypi diffusers
65+
5766
Check you can run the following commands:
58-
python -c "from diffusers import pipeline; classifier = pipeline('text-classification'); print(classifier('What a nice release'))"
67+
python -c "python -c "from diffusers import __version__; print(__version__)"
68+
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('fusing/unet-ldm-dummy-update'); pipe()"
69+
python -c "from diffusers import DiffusionPipeline; pipe = DiffusionPipeline.from_pretrained('hf-internal-testing/tiny-stable-diffusion-pipe', safety_checker=None); pipe('ah suh du')"
5970
python -c "from diffusers import *"
6071
6172
9. Upload the final version to actual pypi:
6273
twine upload dist/* -r pypi
6374
64-
10. Copy the release notes from RELEASE.md to the tag in github once everything is looking hunky-dory.
75+
10. Prepare the release notes and publish them on github once everything is looking hunky-dory.
6576
6677
11. Run `make post-release` (or, for a patch release, `make post-patch`). If you were on a branch for the release,
6778
you need to go back to main before executing this.
@@ -234,10 +245,10 @@ def run(self):
234245
setup(
235246
name="diffusers",
236247
version="0.21.0.dev0", # expected format is one of x.y.z.dev0, or x.y.z.rc1 or x.y.z (no to dashes, yes to dots)
237-
description="Diffusers",
248+
description="State-of-the-art diffusion in PyTorch and JAX.",
238249
long_description=open("README.md", "r", encoding="utf-8").read(),
239250
long_description_content_type="text/markdown",
240-
keywords="deep learning",
251+
keywords="deep learning diffusion jax pytorch stable diffusion audioldm",
241252
license="Apache",
242253
author="The HuggingFace team",
243254
author_email="[email protected]",

0 commit comments

Comments
 (0)