Skip to content

Commit

Permalink
Add publish to pypi step in workflow if on a tag (keitaroinc#42)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mbocevski authored Feb 22, 2021
1 parent e8d5388 commit dfb15b5
Show file tree
Hide file tree
Showing 10 changed files with 182 additions and 14 deletions.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -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.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -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.
29 changes: 28 additions & 1 deletion .github/workflows/pr_checks.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -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 [email protected]. 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
27 changes: 27 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include README.rst
include LICENSE
include requirements.txt
recursive-include ckanext/saml2auth *.html *.json *.js *.less *.css *.mo
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flake8 # for the travis build
flake8 # for the CI build
pysaml2
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dfb15b5

Please sign in to comment.