Skip to content

Commit

Permalink
Merge pull request #1 from extrawest/feature/initial-ocpi-app
Browse files Browse the repository at this point in the history
[feature] Add initial ocpi app
  • Loading branch information
mykola-bulavkin-ew authored Aug 29, 2023
2 parents 2ebf5ec + 90df15e commit 0544791
Show file tree
Hide file tree
Showing 90 changed files with 7,877 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/building_ci_cd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
type: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11.1'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/testing_ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

name: Testing Python Package

on: [push]

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.11.1'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --dev
- name: Run tests
run: |
pipenv run pytest
149 changes: 149 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# Database from docker
postgres-data/
mongodb-data/
40 changes: 40 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
repos:
- repo: https://github.com/ambv/black
rev: 23.1.0
hooks:
- id: black
name: black
entry: black
types_or: [ python, pyi ]
language: python
language_version: python3.11

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
name: flake8
args: ["--max-line-length=82", "--per-file-ignores=__init__.py:F401", "--exclude=tests/*"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
hooks:
- id: mypy
name: mypy
exclude: ^tests/
args: [--ignore-missing-imports ]
language: python
language_version: python3.11
types: [ python ]
require_serial: true
verbose: true
additional_dependencies:
- "pydantic==1.10.12"

- repo: https://github.com/commit-check/commit-check
rev: v0.5.6
hooks:
# - id: check-message
- id: check-branch
- id: check-author-name
- id: check-author-email
75 changes: 75 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@

# Contributing to extrawest_ocpi

---

---

## Requirements

---

pyenv -> [installation guide](https://brain2life.hashnode.dev/how-to-install-pyenv-python-version-manager-on-ubuntu-2004)

Make sure to run after installation:
```bash
pyenv update
```

python >= 3.11.1
```bash
pyenv install 3.11.1
```

pipenv
```bash
pip install pipenv
```


## Installation

---

Clone the project

```bash
git clone https://github.com/extrawest/extrawest_ocpi.git
```

Go to the project directory

```bash
cd extrawest_ocpi
```

Install dependencies

```bash
pipenv --python 3.11.1
```

```bash
pipenv update
```

Activate virtual environment:
```bash
pipenv shell
```

Install pre-commit:
```bash
pre-commit install
```


## Running Tests

---

To run tests, run the following command

```bash
pytest
```
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
python_version = "3.11"

[packages]
pre-commit = "*"
mypy = "*"
black = "*"
fastapi = "*"
pytest = "*"
httpx = "*"
pydantic = "==1.10.12"
commit-helper = "*"
Loading

0 comments on commit 0544791

Please sign in to comment.