Skip to content

Commit b079c34

Browse files
committed
Add PUBLISHING.md
1 parent e56f53c commit b079c34

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

PUBLISHING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Publishing to PyPI
2+
3+
This document contains instructions to publish pydgraph to [PyPI].
4+
5+
[PyPI]: https://www.pypi.org/
6+
7+
## Before deploying
8+
9+
- Get access to credentials for Dgraph's account on PyPI with username dgraph-io
10+
- Setup you `~/.pypirc` file like this: (remember to replace `${password}` with
11+
the actual password)
12+
13+
```
14+
[distutils]
15+
index-servers=
16+
pypi
17+
testpypi
18+
19+
[pypi]
20+
username: dgraph-io
21+
password: ${password}
22+
23+
[testpypi]
24+
repository: https://test.pypi.org/legacy/
25+
username: dgraph-io
26+
password: ${password}
27+
```
28+
29+
## Deploying
30+
31+
- Build and test the code that needs to be published
32+
- Bump version by modifying the `VERSION` variable in `pydgraph/meta.py` file
33+
- If necessary, update the `CHANGELOG.md` file to reflect new changes
34+
- Commit the changes
35+
- Make sure you have [setuptools], [wheel], [twine], and [pypandoc]
36+
installed
37+
- Run the following commands:
38+
39+
```sh
40+
# Remove build and dist directories
41+
rm -rf build
42+
rm -rf dist
43+
44+
# Package you project: source distribution and wheel
45+
python setup.py sdist
46+
python setup.py bdist_wheel
47+
48+
# Upload it to PyPI
49+
twine upload dist/*
50+
# For testing, try uploading to testpypi:
51+
# twine upload --repository testpypi dist/*
52+
```
53+
54+
- If necessary, create a new release tag on the Github repository
55+
56+
[setuptools]: https://pypi.org/project/setuptools/
57+
[wheel]: https://pypi.org/project/wheel/
58+
[twine]: https://pypi.org/project/twine/
59+
[pypandoc]: https://pypi.org/project/pypandoc/

0 commit comments

Comments
 (0)