Skip to content

Commit

Permalink
Merge pull request #22 from ashu-tosh-kumar/development
Browse files Browse the repository at this point in the history
development to main
  • Loading branch information
ashu-tosh-kumar authored Mar 17, 2024
2 parents 6614c38 + 0c346e5 commit 8280923
Show file tree
Hide file tree
Showing 6 changed files with 923 additions and 40 deletions.
52 changes: 30 additions & 22 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,43 @@ name: Python application

on:
push:
branches: [ "main" ]
branches: ["main", "development"]
pull_request:
branches: [ "main" ]
branches: ["main", "development"]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- uses: actions/checkout@v3
- name: Set up Python 3.9.16
uses: actions/setup-python@v3
with:
python-version: "3.9.16"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry export -f requirements.txt --with dev >> requirements.txt
pip install -r requirements.txt
- name: Lint with flake8
run: |
python -m pip install --upgrade pip
pip install poetry
poetry export -f requirements.txt --with dev >> requirements.txt
pip install -r requirements.txt
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --config ./tox.ini
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --config ./tox.ini
- name: Test with pytest
run: |
python -m pip install --upgrade pip
pip install poetry
poetry export -f requirements.txt --with dev >> requirements.txt
pip install -r requirements.txt
pytest
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
repos:
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.3.0
hooks:
- id: black
args: [--config=./pyproject.toml]
language_version: python3.11
language_version: python3.9.16

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
args: [--config=./tox.ini]
language_version: python3.11
language_version: python3.9.16

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
language_version: python3.11
args: ["--settings-path", "pyproject.toml"]
language_version: python3.9.16

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: requirements-txt-fixer
language_version: python3.11
language_version: python3.9.16
- id: debug-statements
- id: detect-aws-credentials
- id: detect-private-key
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Using file](#using-file)
- [Using Terminal](#using-terminal)
- [Implementation Details](#implementation-details)
- [Changelog](#changelog)

## Introduction

Expand Down Expand Up @@ -108,8 +109,9 @@ And, we can minimize this function to find all $N_i$.
## How to use?

Right now there are two ways of using the code. But first setup a virtual environment
and install the requirements using `pip install -r requirements.txt` command. If there's
an interest and people find it useful, I can build a simple UI for usage.
and install the requirements using `pip install poetry` and then, `poetry install`
command. If there's an interest and people find it useful, I can build a simple UI for
usage.

### Using file

Expand Down Expand Up @@ -149,3 +151,9 @@ The repository contains three parts:
- `views`: It provides interface to end users to interact with the code. Currently there
are two interfaces viz. a terminal based `src/views/terminal.py` and a file based
`src/views/file.py`.

## Changelog

`v.0.1.0`

- first working release.
Loading

0 comments on commit 8280923

Please sign in to comment.