From dfb15b50582ad4f72f5ed2b4a98ee855d1ecf5de Mon Sep 17 00:00:00 2001 From: Marko Bocevski Date: Mon, 22 Feb 2021 15:49:53 +0100 Subject: [PATCH] Add publish to pypi step in workflow if on a tag (#42) * Add publish to pypi step in workflow if on a tag * Change label for parallel unit tests * Bump version number and clean up the docs * Add code of conduct, contributor guideline and issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 20 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++ .github/workflows/{pr_checks.yml => ci.yml} | 29 +++++++- CODE_OF_CONDUCT.md | 76 +++++++++++++++++++++ CONTRIBUTING.md | 27 ++++++++ MANIFEST.in | 1 - README.rst | 18 ++--- dev-requirements.txt | 2 +- requirements.txt | 1 - setup.py | 2 +- 10 files changed, 182 insertions(+), 14 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md rename .github/workflows/{pr_checks.yml => ci.yml} (76%) create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md delete mode 100644 requirements.txt diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..4dabac87 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,20 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]" +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**ckanext-saml2auth version affected** +v1.1.0 + +**Expected behaviour** +A clear and concise description of what you expected to happen. + +**Logs** +If applicable, add logs to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..fe47f95a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[FEATURE]" +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context about the feature request here. diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/ci.yml similarity index 76% rename from .github/workflows/pr_checks.yml rename to .github/workflows/ci.yml index 7b15400f..139fab28 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,34 @@ jobs: uses: AndreMiras/coveralls-python-action@develop with: parallel: true - flag-name: Unit Test + flag-name: Python ${{ matrix.python-version }} Unit Test + + publish: + needs: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install setup requirements + run: | + python -m pip install --upgrade setuptools wheel twine + + - name: Build and package + run: | + python setup.py sdist bdist_wheel + twine check dist/* + + - name: Publish package + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} coveralls_finish: needs: test diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..04b029f9 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at info@keitaro.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..a8d59e88 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,27 @@ +## How to contribute to ckanext-saml2auth + +#### **Did you find a bug?** + +* **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/keitaroinc/ckanext-saml2auth/issues). + +* If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/keitaroinc/ckanext-saml2auth/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, we include an issue template to help out in filling-in the issue. + +#### **Did you write a patch that fixes a bug?** + +* Open a new GitHub pull request with the patch. + +* Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. + +#### **Do you intend to add a new feature or change an existing one?** + +* [Create a new feature issue](https://github.com/keitaroinc/ckanext-saml2auth/issues/new) using the Feature Request template and describe your proposed changes + +* Submit a pull request referring to the relevant feature issue/s + +#### **Do you have questions about the source code?** + +* Ask any question about how to use ckanext-saml2auth in our [gitter chat](https://gitter.im/keitaroinc/ckan). + +Thanks! + +Keitaro Team diff --git a/MANIFEST.in b/MANIFEST.in index 4fa4bffe..3596f63d 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,3 @@ include README.rst include LICENSE -include requirements.txt recursive-include ckanext/saml2auth *.html *.json *.js *.less *.css *.mo diff --git a/README.rst b/README.rst index 46e483a4..db014c5f 100644 --- a/README.rst +++ b/README.rst @@ -4,6 +4,9 @@ .. image:: https://coveralls.io/repos/github/keitaroinc/ckanext-saml2auth/badge.svg?branch=main :target: https://coveralls.io/github/keitaroinc/ckanext-saml2auth?branch=main +.. image:: https://badges.gitter.im/keitaroinc/ckan.svg) + :target: https://gitter.im/keitaroinc/ckan?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge + .. image:: https://img.shields.io/pypi/v/ckanext-saml2auth :target: https://pypi.org/project/ckanext-saml2auth @@ -40,25 +43,22 @@ Installation To install ckanext-saml2auth: -1. Install the required packages:: +1. Install the required system packages:: sudo apt install xmlsec1 - 2. Activate your CKAN virtual environment, for example:: . /usr/lib/ckan/default/bin/activate -3. Install the ckanext-saml2auth Python package into your virtual environment:: - - pip install ckanext-saml2auth - - -4. Install the python modules required by the extension (adjusting the path according to where ckanext-saml2auth was installed in the previous step):: +3. Install the required system packages to install the necessary python module dependencies:: # rustc and cargo are neeeded to build cryptography if no binary wheel exists sudo apt install rustc cargo - pip install -r requirements.txt + +4. Install the ckanext-saml2auth Python package into your virtual environment:: + + pip install ckanext-saml2auth 5. Add ``saml2auth`` to the ``ckan.plugins`` setting in your CKAN config file (by default the config file is located at diff --git a/dev-requirements.txt b/dev-requirements.txt index 99b226ec..61015aef 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,2 +1,2 @@ -flake8 # for the travis build +flake8 # for the CI build pysaml2 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 4ee801cf..00000000 --- a/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pysaml2 \ No newline at end of file diff --git a/setup.py b/setup.py index c847505b..6149f01c 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # http://packaging.python.org/en/latest/tutorial.html#version - version='1.0.2', + version='1.1.0', description='''An extension to enable Single Sign On(SSO) for CKAN data portals via SAML2 Authentication.''', long_description=long_description,