Thank you for your interesting in contributing to this open-source project! Make sure that you have read and understood our code of conduct.
Please follow the following steps for local testing:
git clone https://github.com/plotly/dash-cytoscape.git
npm run build:py
) you need to create a
venv for this project. Make sure you have virtualenv
correctly installed and run this:mkdir dash_cytoscape_dev
cd dash_cytoscape_dev
virtualenv venv # Create a virtual env
source venv/bin/activate # Activate the venv
pip install -r requirements.txt # Install the requirements
To activate in windows, replace the 4th line with this:
venv\Scripts\activate
yarn
yarn run build:all
Please lint any additions to Python code with pylint
and flake8
:
flake8 --max-line-length=100 usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py
flake8 --max-line-length=100 demos tests
pylint usage.py usage-advanced.py usage-elements.py usage-events.py usage-stylesheet.py
pylint demos tests
Is your code clear? If you had to go back to it in a month, would you be happy to? If someone else had to contribute to it, would they be able to?
A few suggestions:
Make your variable names descriptive and use the same naming conventions throughout the code.
For more complex pieces of logic, consider putting a comment, and maybe an example.
In the comments, focus on describing why the code does what it does, rather than describing what it does. The reader can most likely read the code, but not necessarily understand why it was necessary.
Don't overdo it in the comments. The code should be clear enough to speak for itself. Stale comments that no longer reflect the intent of the code can hurt code comprehension.
Activate your virtualenv:
source venv/bin/activate
If needed, install the requirements:
pip install -r tests/requirements.txt
Run the following tests:
python -m unittest tests.test_callbacks
python -m unittest tests.test_interactions
python -m unittest tests.test_usage
Look inside the tests/screenshots
directory to find the images created by the tests. If you have
Percy configured, run the following test:
python -m unittest tests.test_percy_snapshot
Make sure to configure your Percy environment variables correctly:
PERCY_BRANCH=local
PERCY_ENABLED=1
PERCY_TOKEN=***************
You can find the token in the project settings of the Percy project. Only members of the Plotly organizations have access to this token.
The tests are broken down in 3 categories:
elements
, stylesheet
and layout
properties can be updated correctly by other Dash components using callbacks.Those tests are rendered into images located inside tests/screenshots
, which are then sent to a Percy build using tests.test_percy_snapshot
, which creates a Dash app that only serves the content of tests/screenshots
at different routes, which are then captured by the Percy runner.
Create a pull request and tag the Plotly team (@plotly/dash_bio
) and tag / request review from @xhlulu.
After a review has been done and your changes have been approved, create a prerelease and comment in the PR. Version numbers should follow semantic versioning.
To publish or create a prerelease:
MANIFEST.in
has all of the extra files (like CSS)package.json
, update the CHANGELOG, and make a pull requestnpm run build:all
python setup.py sdist
cp dist/dash_cytoscape-x.x.x.tar.gz ../temp
cp usage.py ../temp
cd ../temp
source venv/bin/activate
pip install dash_cytoscape-x.x.x.tar.gz
python usage.py
npm publish
twine upload dist/dash_cytoscape-x.x.x.tar.gz
git tag -a 'vx.x.x' -m 'vx.x.x'
git push origin master --follow-tags
cd ../temp
pip install dash-cytoscape==x.x.x
python usage.py
Make a post in the Dash Community Forum
":mega: Announcement! New <Your Feature> - Feedback Welcome"
Beginner tip: Copy and paste this section as a comment in your PR, then check off the boxes as you go!
npm run build:all
.git tag v<version_number>
(for the contributor merging the PR).git push <tag_name>
(for the contributor merging the PR).git remote show origin
shows you are in the correct repository.git branch
shows that you are on the expected branch.git status
shows that there are no unexpected changes.package.json
and dash_cytoscape/package.json
versions have been correctly updated.Complete the "Publishing" section.
requirements.txt
file and you have assigned @chriddyp
to review.Our preferred package manager for this project is Yarn. Therefore we use yarn.lock
rather than package-lock.json
. If you decide to start using npm for package management (which will create package-lock.json) and you commit this project to Dokku, make sure to delete yarn.lock
.
Dash, and many of Plotly's open source products, have been funded through direct sponsorship by companies. Get in touch about funding feature additions, consulting, or custom app development.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。