Skip to content

Commit a2b20da

Browse files
feat(akande): ✨ Initial commit v0.0.1
1 parent 175f22a commit a2b20da

26 files changed

+2625
-201
lines changed

.github/CODE-OF-CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our
7+
project and our community a harassment-free experience for everyone,
8+
regardless of age, body size, disability, ethnicity, gender identity and
9+
expression, level of experience, nationality, personal appearance, race,
10+
religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behaviour that contributes to creating a positive
15+
environment include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behaviour by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual
26+
attention or advances
27+
- Trolling, insulting/derogatory comments, and personal or political
28+
attacks
29+
- Public or private harassment
30+
- Publishing others' private information, such as a physical or
31+
electronic address, without explicit permission
32+
- Other conduct which could reasonably be considered inappropriate in a
33+
professional setting
34+
35+
## Our Responsibilities
36+
37+
Project maintainers are responsible for clarifying the standards of
38+
acceptable behaviour and are expected to take appropriate and fair
39+
corrective action in response to any instances of unacceptable
40+
behaviour.
41+
42+
Project maintainers have the right and responsibility to remove, edit,
43+
or reject comments, commits, code, wiki edits, issues, and other
44+
contributions that are not aligned to this Code of Conduct, or to ban
45+
temporarily or permanently any contributor for other behaviors that they
46+
deem inappropriate, threatening, offensive, or harmful.
47+
48+
## Scope
49+
50+
This Code of Conduct applies both within project spaces and in public
51+
spaces when an individual is representing the project or its community.
52+
Examples of representing a project or community include using an
53+
official project e-mail address, posting via an official social media
54+
account, or acting as an appointed representative at an online or
55+
offline event. Representation of a project may be further defined and
56+
clarified by project maintainers.
57+
58+
## Enforcement
59+
60+
Instances of abusive, harassing, or otherwise unacceptable behaviour may
61+
be reported by contacting the project team. The project team will review
62+
and investigate all complaints, and will respond in a way that it deems
63+
appropriate to the circumstances. The project team is obligated to
64+
maintain confidentiality with regard to the reporter of an incident.
65+
Further details of specific enforcement policies may be posted
66+
separately.
67+
68+
Project maintainers who do not follow or enforce the Code of Conduct in
69+
good faith may face temporary or permanent repercussions as determined
70+
by other members of the project's leadership.
71+
72+
## Attribution
73+
74+
This Code of Conduct is adapted from the Contributor Covenant homepage,
75+
version 1.4, available at
76+
[version](http://contributor-covenant.org/version/1/4)

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@sebastienrousseau/akande

.github/SECURITY.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Security
2+
3+
We take the security of our software products and services seriously,
4+
which includes all source code repositories managed through our GitHub
5+
repositories.
6+
7+
If you believe you have found a security vulnerability in any of our
8+
repository, please report it to us as described below.
9+
10+
## Reporting Security Issues
11+
12+
Please include the requested information listed below (as much as you
13+
can provide) to help us better understand the nature and scope of the
14+
possible issue:
15+
16+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site
17+
scripting, etc.)
18+
- Full paths of source file(s) related to the manifestation of the issue
19+
- The location of the affected source code (tag/branch/commit or direct
20+
URL)
21+
- Any special configuration required to reproduce the issue
22+
- Step-by-step instructions to reproduce the issue
23+
- Proof-of-concept or exploit code (if possible)
24+
- Impact of the issue, including how an attacker might exploit the issue
25+
26+
This information will help us triage your report more quickly.

.github/funding.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: sebastienrousseau
2+
custom: https://paypal.me/wwdseb

.github/workflows/ci.yml

Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
name: ❯ Python akande
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- "feat/*"
8+
push:
9+
branches:
10+
- main
11+
- "feat/*"
12+
13+
jobs:
14+
# This job reads the version number from setup.cfg and sets it as an
15+
# environment variable
16+
version:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
version: ${{ steps.set-version.outputs.version }}
20+
steps:
21+
- name: ❯ Set up Python 🐍
22+
uses: actions/setup-python@v2
23+
with:
24+
python-version: "3.9"
25+
- name: ❯ Get version number from setup.cfg
26+
id: set-version
27+
run: |
28+
echo "::set-output name=version::$(python -c 'import configparser; cfg = configparser.ConfigParser(); cfg.read("setup.cfg"); print(cfg.get("metadata", "version"))')"
29+
30+
# This job runs unit tests using pytest
31+
pytest:
32+
needs: version
33+
runs-on: ubuntu-latest
34+
steps:
35+
# Check out the repository code
36+
- uses: actions/checkout@v4
37+
38+
# Set up Python and install dependencies
39+
- name: ❯ Set up Python and install dependencies 🐍📦
40+
uses: actions/setup-python@v2
41+
with:
42+
python-version: "3.9"
43+
- name: ❯ Install dependencies 📦
44+
run: |
45+
python -m pip install --upgrade pip
46+
python -m pip install -r requirements.txt
47+
# python -m pip install pytest pytest-cov
48+
49+
# Run pytest
50+
# - name: ❯ Run pytest 🧪
51+
# run: pytest --cov=akande --cov-report=xml
52+
53+
# Upload code coverage report to Codecov
54+
# - name: ❯ Upload code coverage report to Codecov 📊
55+
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
56+
# uses: codecov/codecov-action@v1
57+
# with:
58+
# token: ${{ secrets.CODECOV_TOKEN }}
59+
60+
# This job runs flake8 to check for code style issues
61+
lint:
62+
needs: version
63+
runs-on: ubuntu-latest
64+
steps:
65+
# Check out the repository code
66+
- uses: actions/checkout@v4
67+
# Set up Python and install dependencies
68+
- name: ❯ Set up Python and install dependencies 🐍📦
69+
uses: actions/setup-python@v2
70+
with:
71+
python-version: "3.9"
72+
- name: ❯ Install flake8 📦
73+
run: python -m pip install flake8
74+
# Run flake8
75+
- name: ❯ Run flake8 🔍
76+
run: flake8
77+
78+
# This job builds the distribution packages, and publishes them
79+
# to PyPI
80+
build:
81+
needs: [version, pytest]
82+
runs-on: ubuntu-latest
83+
env:
84+
TWINE_USERNAME: __token__
85+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
86+
VERSION: ${{ needs.version.outputs.version }}
87+
PKG_NAME: akande
88+
steps:
89+
# Check out the repository code
90+
- uses: actions/checkout@v4
91+
- name: ❯ Set up Python 🐍
92+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
93+
id: python
94+
uses: actions/setup-python@v2
95+
with:
96+
python-version: "3.9"
97+
98+
# Install dependencies
99+
- name: ❯ Install dependencies 📦
100+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
101+
run: |
102+
python -m pip install --upgrade pip setuptools wheel
103+
python -m pip install -r requirements.txt
104+
105+
# Update the version number based on the setup.cfg file
106+
- name: Update version number from setup.cfg file 📝
107+
id: update-version
108+
run: |
109+
NEW_VERSION=$(grep -E '^version =' setup.cfg | cut -d '=' -f 2 | tr -d '[:space:]')
110+
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
111+
shell: /bin/bash -e {0}
112+
113+
# Generate the changelog based on git log and template file
114+
- name: Generate Changelog 📚
115+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
116+
run: |
117+
# Append version information to CHANGELOG.md
118+
echo "## Release v${{ env.VERSION }} - $(date +'%Y-%m-%d')" >> ${{ github.workspace }}/CHANGELOG.md
119+
# Copy content of template file to CHANGELOG.md
120+
cat TEMPLATE.md >> ${{ github.workspace }}/CHANGELOG.md
121+
# Append git log to CHANGELOG.md
122+
echo "$(git log --pretty=format:'%s' --reverse $(git describe --tags --abbrev=0)..HEAD)" >> ${{ github.workspace }}/CHANGELOG.md
123+
# Append empty line to CHANGELOG.md
124+
echo "" >> ${{ github.workspace }}/CHANGELOG.md
125+
126+
# Build distribution packages
127+
- name: ❯ Build distribution packages 🧰
128+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
129+
run: |
130+
python setup.py sdist bdist_wheel
131+
132+
# Publish distribution packages to PyPI
133+
- name: ❯ Publish distribution packages to PyPI 🚀
134+
id: publish
135+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
136+
uses: pypa/gh-action-pypi-publish@v1.3.1
137+
with:
138+
user: ${{ env.TWINE_USERNAME }}
139+
password: ${{ env.TWINE_PASSWORD }}
140+
packages_dir: dist
141+
verify_metadata: true
142+
skip_existing: true
143+
144+
# Append artifact links to the changelog
145+
- name: Append Artifact Links 🔗
146+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
147+
run: |
148+
echo "" >> ${{ github.workspace }}/CHANGELOG.md
149+
echo "## Artifacts 🎁" >> ${{ github.workspace }}/CHANGELOG.md
150+
for filename in dist/*; do
151+
link="$(basename $filename)"
152+
echo "* [$link](${{ env.RELEASES_URL }}/$link)" >> ${{ github.workspace }}/CHANGELOG.md
153+
done
154+
env:
155+
RELEASES_URL: https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}
156+
157+
# Create a release
158+
- name: Create Release 🚀
159+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
160+
id: create_release
161+
uses: actions/create-release@v1
162+
env:
163+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164+
with:
165+
tag_name: v${{ env.VERSION }}
166+
release_name: Release v${{ env.VERSION }}
167+
body_path: ${{ github.workspace }}/CHANGELOG.md
168+
draft: false
169+
prerelease: false
170+
171+
- name: Upload Release Assets 📦
172+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
173+
env:
174+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
175+
run: |
176+
upload_url=${{ steps.create_release.outputs.upload_url }}
177+
for file in dist/*; do
178+
curl \
179+
-H "Authorization: token ${GITHUB_TOKEN}" \
180+
-H "Content-Type: $(file --mime-type -b $file)" \
181+
--data-binary @$file \
182+
"${upload_url}?name=$(basename $file)"
183+
done

0 commit comments

Comments
 (0)