Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways:
Report bugs at https://github.com/drivendata/nbautoexport/issues.
If you are reporting a bug, please include:
- Your operating system name and version.
- Any details about your local setup that might be helpful in troubleshooting.
- Detailed steps to reproduce the bug.
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help wanted" is open to whoever wants to implement it.
Look through the GitHub issues for features. Anything tagged with "enhancement" and "help wanted" is open to whoever wants to implement it.
nbautoexport could always use more documentation, whether as part of the official nbautoexport docs, in docstrings, or even on the web in blog posts, articles, and such.
The best way to send feedback is to file an issue at https://github.com/drivendata/nbautoexport/issues.
If you are proposing a feature:
- Explain in detail how it would work.
- Keep the scope as narrow as possible, to make it easier to implement.
- Remember that this is a volunteer-driven project, and that contributions are welcome :)
Ready to contribute? Here's how to set up nbautoexport
for local development.
- Fork the
nbautoexport
repo on GitHub. - Clone your fork locally:
git clone https://github.com/YOUR_ACCOUNT_NAME/nbautoexport.git
- Install your local copy into a virtual environment. Here's how to set one up with Python's built in
venv
module.
cd nbautoexport/
python -m venv ./.venv
source .venv/bin/activate
pip install -r requirements-dev.txt
- Create a branch for local development:
git checkout -b name-of-your-bugfix-or-feature
Now you can make your changes locally.
- When you're done making changes, check that your changes pass linting and the tests:
make lint
make test
- Commit your changes and push your branch to GitHub:
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
- Submit a pull request through the GitHub website.
Before you submit a pull request, check that it meets these guidelines:
- The pull request should include tests.
- If the pull request adds functionality, please ensure you have created appropriate documentation.
- The pull request should work for Python 3.6, 3.7 and 3.8 and different operating systems. Check GitHub Actions and make sure that the tests pass for all supported Python versions and environments.
To run a subset of tests, for example:
pytest tests/test_export.py
To release a new version of nbautoexport
, create a new release using the GitHub releases UI. The tag version must have a prefix v
and should have a semantic versioning format, e.g., v0.1.0
.
On publishing of the release, the release
GitHub action workflow will be triggered. This workflow builds the package and publishes it to PyPI. You will be able to see the workflow status in the Actions tab.
The built package for nbautoexport
will automatically match the created git tag via the dynamic versioning functionality of the build backend, pdm-pep517.
The documentation website is an mkdocs static site hosted on Netlify. The built website assets are typically first staged on the gh-pages
branch and then deployed to Netlify automatically using GitHub Actions workflows.
We use the mike
tool to manage the documentation versions with the following conventions.
- We keep the docs of the latest patch of a
<major>.<minor>
version, e.g.,v0.2.1
is keyed as"v0.2"
and titled as"v0.2.1"
. - The current stable version is tagged with the alias
"stable"
and has"(stable)"
as part of the title. - The head of the
master
branch is keyed as"~latest"
and titled as"latest"
To deploy the latest docs from the master branch, all you need to do is manually trigger the docs-master
GitHub Actions workflow.
To manually deploy a previously released version, you will need to use mike
. Follow the instructions in the following section.
Note that mike
needs to be run in the same direct as mkdocs.yml
. To avoid changing directories all the time (since we keep it inside the docs/
subdirectory), you can shadow the mike
command with the following shell function:
# Put this in your .bash_profile or wherever you put aliases
mike() {
if [[ -f mkdocs.yml ]]; then
command mike "$@"
else
(cd docs && command mike "$@")
fi
}
The general steps of deploying docs for a specific version involve:
- Make sure your local
gh-pages
is up to date with GitHub, i.e.,git fetch origin && git checkout gh-pages && git pull origin gh-pages
- Switch to whatever commit you're intending to deploy from.
- Run
make docs
. (This is necessary because of steps needed before running mkdocs things.) - Run whatever
mike
command (see below). If you include the--push
flag, it will also directly push your changes to GitHub. If you don't, it will only commit to your localgh-pages
and you'll need to then push that branch to GitHub. - Trigger the
docs-master
GitHub actions workflow, which will deploy thegh-pages
branch to Netlify.
Staging the stable version will be something like this:
mike deploy v0.3 stable --title="v0.3.1 (stable)" --no-redirect --update-aliases
Staging an older version looks something like this:
mike deploy v0.2 --title="v0.2.1"