Skip to content

Commit

Permalink
Merge pull request #4 from mdapena/core
Browse files Browse the repository at this point in the history
PyPI Publishing Workflow and Docs Improvements
  • Loading branch information
mdapena authored Dec 17, 2023
2 parents 7516381 + 3d5800e commit 1a34b2e
Show file tree
Hide file tree
Showing 29 changed files with 431 additions and 62 deletions.
136 changes: 136 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders 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, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[INSERT CONTACT METHOD].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org

[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html

[Mozilla CoC]: https://github.com/mozilla/diversity

[FAQ]: https://www.contributor-covenant.org/faq

[translations]: https://www.contributor-covenant.org/translations
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please read the [Contributing](https://mdapena.github.io/pyventus/contributing/) guidelines in the documentation site.
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Deploy Docs
name: Docs

on:
push:
branches:
Expand All @@ -13,20 +14,22 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v4
with:
python-version: 3.x
python-version: "3.10"
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v3
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin
- run: pip install . mkdocs-material mkdocstrings[python] mkdocs-git-revision-date-localized-plugin mkdocs-git-authors-plugin
- run: mkdocs gh-deploy --force
55 changes: 55 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: PyPI

on:
release:
types:
- created

jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build

- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/pyventus

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
File renamed without changes.
26 changes: 26 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: Pyventus
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Manuel
family-names: Da Pena
email: dapensoft@gmail.com
repository-code: 'https://github.com/mdapena/pyventus'
url: 'https://mdapena.github.io/pyventus/'
abstract: >-
A modern and robust Python package for event-driven
programming. Define, emit, and orchestrate events with
ease using customizable event emitters and flexible
responses.
keywords:
- events
- event-emitter
- event-handler
- event-linker
license: MIT
35 changes: 31 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
<br>

<p align="center">
<img src="docs/images/logo/pyventus-logo-name-slogan.svg" alt="Pyventus" width="750px">
<img src="https://mdapena.github.io/pyventus/images/logo/pyventus-logo-name-slogan.svg" alt="Pyventus" width="750px">
</p>

<br>

<p align="center">

<a href="https://github.com/mdapena/pyventus/actions?query=workflow%3ATests+event%3Apush+branch%3Amaster" target="_blank">
<img src="https://github.com/mdapena/pyventus/actions/workflows/run-tests.yml/badge.svg?branch=master" alt="Tests">
</a>

<a href="https://github.com/mdapena/pyventus/actions?query=workflow%3ADocs+event%3Apush+branch%3Amaster" target="_blank">
<img src="https://github.com/mdapena/pyventus/actions/workflows/deploy-docs.yml/badge.svg?branch=master" alt="Docs">
</a>

<a href="https://pypi.org/project/pyventus" target="_blank">
<img src="https://img.shields.io/pypi/v/pyventus?color=blue" alt="Package version">
</a>

<a href="https://pypi.org/project/pyventus" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/pyventus?color=blue" alt="Supported Python versions">
</a>

<a href="https://github.com/psf/black">
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black">
</a>

</p>

<br>


---

**Documentation**: <a href="#" target="_blank">https://github.com/mdapena/pyventus</a>
**Documentation**: <a href="https://mdapena.github.io/pyventus" target="_blank">https://mdapena.github.io/pyventus</a>

**Source Code**: <a href="https://github.com/mdapena/pyventus" target="_blank">https://github.com/mdapena/pyventus</a>

Expand Down Expand Up @@ -410,7 +437,7 @@ event_emitter.emit("StringEvent")

<p style='text-align: justify;'>
&emsp;&emsp;Pyventus is an open source project that welcomes community involvement. If you wish to contribute
additional event emitters, improvements, or bug fixes, please check the <a href="#">Contributing</a> section
additional event emitters, improvements, or bug fixes, please check the <a href="https://mdapena.github.io/pyventus/contributing/">Contributing</a> section
for guidelines on collaborating. Together, we can further the possibilities of event-driven development.
</p>

Expand All @@ -420,6 +447,6 @@ event_emitter.emit("StringEvent")

<p style='text-align: justify;'>
&emsp;&emsp;Pyventus is distributed as open source software and is released under the <a href="https://choosealicense.com/licenses/mit/" target="_blank">MIT License</a>.
You can view the full text of the license in the <code>LICENSE</code> file located in the <a href="https://github.com/mdapena/pyventus" target="_blank">Pyventus repository</a>.
You can view the full text of the license in the <code>LICENSE</code> file located in the <a href="https://github.com/mdapena/pyventus/blob/master/LICENSE" target="_blank">Pyventus repository</a>.
</p>

2 changes: 2 additions & 0 deletions docs/api/emitters/asyncio-event-emitter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `AsyncIOEventEmitter` class

::: pyventus.AsyncIOEventEmitter

<br>
2 changes: 2 additions & 0 deletions docs/api/emitters/executor-event-emitter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `ExecutorEventEmitter` class

::: pyventus.ExecutorEventEmitter

<br>
2 changes: 2 additions & 0 deletions docs/api/emitters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
- __init__
- emit
- _execute

<br>
2 changes: 2 additions & 0 deletions docs/api/emitters/rq-event-emitter.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `RQEventEmitter` class

::: pyventus.RQEventEmitter

<br>
2 changes: 2 additions & 0 deletions docs/api/event-handler.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `EventHandler` class

::: pyventus.EventHandler

<br>
2 changes: 2 additions & 0 deletions docs/api/event-linker.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# `EventLinker` class

::: pyventus.EventLinker

<br>
3 changes: 2 additions & 1 deletion docs/api/event.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# `Event` dataclass

::: pyventus.Event


<br>
4 changes: 3 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ hatch run tests:all
## Code of Conduct

<p style='text-align: justify;' markdown>
&emsp;&emsp;This project and everyone participating in it is governed by the [Pyventus Code of Conduct](https://github.com/mdapena/pyventus/CODE_OF_CONDUCT.md).
&emsp;&emsp;This project and everyone participating in it is governed by the [Pyventus Code of Conduct](https://github.com/mdapena/pyventus/.github/CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable behavior.
</p>

Expand All @@ -291,3 +291,5 @@ hatch run tests:all
and greatly appreciated. If you have any questions or need further clarification, please don't
hesitate to reach out. We look forward to collaborating with you to enhance this project!
</p>

<br>
Loading

0 comments on commit 1a34b2e

Please sign in to comment.