For general contribution and community guidelines, please see the community repo. In particular, before contributing please review our contributor licensing guide to ensure your contribution is compliant with our contributor license agreements.
To set up a development environment follow the instructions in this section.
- Create a directory that will hold all the
virtualenv
packages and files. Note: You need to run this command once only.
macOS:
python3 -m venv venv
Windows:
py -m venv venv
- Enable your terminal to use the files in this directory using this command. Note: This command needs to run each time you return to your virtual environment.
macOS:
source venv/bin/activate
Windows:
venv\Scripts\activate.bat
- Install the requirements
pip3 install -r requirements.txt
You can now run tests and the SDK with modifiable files.
To test the SDK against a locally running Conjur Server, see Manual testing
If you want to install the SDK using pip
without uploading it to pypi
you can run the following command from the
repo source dir:
pip3 install .
Note that the SDK requires Python version >= than the one specified in the setup.cfg
file under the python_requires
field.
In the project, a linter is used to help enforce coding standards and provides refactoring suggestions.
./ci/test/test_linting.sh
To run the unit test isolated inside a container, run:
./ci/test/test_unit.sh
To run integration tests run:
./ci/test/test_integration -e ubuntu
This creates a Conjur environment with an Ubuntu container running the SDK's integration tests.
To perform manual tests, run:
./ci/test/test_integration -e ubuntu -d
This creates a Conjur environment with an Ubuntu container running in interactive mode. You can now run Python and manually test the SDK.
The connection parameters to Conjur are:
- conjur_url =
https://conjur-https
- username =
admin
- account =
dev
- api_key = stored inside the
CONJUR_AUTHN_API_KEY
environment variable. You can fetch the value by runningecho $CONJUR_AUTHN_API_KEY
Releases should be created by maintainers only. To create and promote a release, follow the instructions in this section.
NOTE: If the Changelog and NOTICES.txt are already up-to-date, skip this step and promote the desired release build from the main branch.
- Create a new branch for the version bump.
- Based on the changelog content, determine the new version number and update.
- Review the git log and ensure the changelog contains all relevant recent changes with references to GitHub issues or PRs, if possible.
- Review the changes since the last tag, and if the dependencies have changed revise the NOTICES to correctly capture the included dependencies and their licenses / copyrights.
- Commit these changes -
Bump version to x.y.z
is an acceptable commit message - and open a PR for review.
- Merging into the main branch will automatically trigger a release build. If successful, this release can be promoted at a later time.
- Jenkins build parameters can be utilized to promote a successful release or manually trigger aditional releases as needed.
- Reference the internal automated release doc for releasing and promoting.
- Log into PyPIand verify that the package uploaded successfully
- Import the package locally by running
pip install conjur-api==<version_number>
, for examplepip install conjur-api==0.0.5
- Verify git release page from the tag. Click here for assistance
- Fork the project
- Clone your fork
- Make local changes to your fork by editing files
- Commit your changes
- Push your local changes to the remote server
- Create new Pull Request
From here your pull request will be reviewed and once you've responded to all feedback it will be merged into the project. Congratulations, you're a contributor!