...
- If you're not familiar with how to package a Python JS module and and share it on PyPINPM, get your bearings by reading this guide.
- Write a setup.py for your package.
- Make sure you:
- Indicate a license type, AGPL or Apache (
license
). Link to which license you should use: /wiki/spaces/OPEN/pages/13959332 - Indicate which packages your package requires in order to run (
install_requires
) - Use "edX" as the package author (
author
) - Use "oscm@edx.org" as the package author's email address (
author_email
)
- Indicate a license type, AGPL or Apache (
- A simple example is here.
- If your package includes console scripts, see this example.
- Make sure you:
- Test your setup.py by publishing your package to the PyPI staging server.
- Create an account at https://testpypi.python.org/pypi.
- Follow the instructions in the guide linked above.
- The first upload of your package has to be done manually.
- Get the pypi edX credentials from devops, or ask them to do these steps
- Modify your repo's Travis configuration so that a source distribution and a wheel for your package are published when new tags are pushed to mastertagging a release results in a publish to npmjs.
Contact DevOps to get
credentialspublish tokens for the edX
PyPINPMJS account. Use the Travis CI command line client to encrypt the
passwordtoken:
An exampleCode Block language bash travis encrypt --add deploy.password
.travis.yml
is here.api_key NPMTOKEN
- There are two options here, using the Stages feature of Travis (studio-frontend) or using Travis' simple built-in deploy
- Travis documentation on PyPI NPM deployment.
- To publish a new version of your package to PyPI, update the version in setup.py, then push a corresponding tag to GitHub.
- You're done! Don't forget to update your requirements webpack files so that they install your download the new package from PyPINPM.
Install twine, build a kit, and upload it:
Code Block |
---|
pip install twine wheel
python setup.py sdist bdist_wheel
twine upload -u edX -p Q6GQT_THE_PASSWORD_6H8DF dist/* |
Info |
---|
Find your package at https://pypi.python.org/pypi/[package-name]/[version] |
...