Skip to content

Commit 367b2d6

Browse files
committed
update deps version, fix flake8 issues
1 parent 364d851 commit 367b2d6

21 files changed

+1067
-245
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
exclude = .github,.git,__pycache__,docs/source/conf.py,old,build,dist,models.py,omymodels/test.py
3+
ignore = D100, D103, D101, D102, D104,D107, D403, D210, D400, D401, W503, W293, D205
4+
max-complexity = 10
5+
max-line-length = 120
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Tests Pipeline
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
flake8_py3:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Set up Python 3.6
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.6
18+
- name: Install dependencies
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install flake8 pytest
22+
23+
- name: Run flake8 (suo)
24+
uses: julianwachholz/flake8-action@v2
25+
with:
26+
checkName: 'flake8_py3'
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
tests:
31+
runs-on: ubuntu-latest
32+
needs: [flake8_py3]
33+
strategy:
34+
matrix:
35+
python: [3.6, 3.7, 3.8, 3.9]
36+
steps:
37+
- uses: actions/checkout@v2
38+
- name: Set up Python
39+
uses: actions/setup-python@v2
40+
with:
41+
python-version: ${{ matrix.python }}
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
pip install poetry
46+
poetry install
47+
env:
48+
POETRY_VIRTUALENVS_CREATE: false
49+
- name: Test with pytest
50+
run: |
51+
pytest tests/ -vv

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea
22
dist/
33
codegraph.egg-info/
4-
codegraph/__pycache__/
4+
codegraph/__pycache__/
5+
*/__pycache__/

CHANGELOG.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**v0.1.0**
2+
### Improvements
3+
4+
1. Command line tool name changed from 'cg' to 'codegraph'.
5+
2. Updated versions of dependencies
6+
3. Minimal supported python version up to 3.8
7+
4. Cleaned up code

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
### CodeGraph - static code analyzator, that create a diagram with your code structure.
2+
3+
![badge1](https://img.shields.io/pypi/v/codegraph) ![badge2](https://img.shields.io/pypi/l/codegraph) ![badge3](https://img.shields.io/pypi/pyversions/codegraph)![workflow](https://github.com/xnuinside/codegraph/actions/workflows/main.yml/badge.svg)
4+
5+
Tool that create a digram with your code structure to show dependencies between code entities (methods, modules, classes and etc).
6+
Main advantage of CodeGraph, that is does not execute the code itself. You not need to activate any environments or install dependencies to analyse the target code.
7+
It is based only on lex and syntax parse, so it not need to install all your code dependencies.
8+
9+
10+
### Install codegraph
11+
```console
12+
13+
pip install codegraph
14+
15+
```
16+
17+
### Analyze your code
18+
19+
codegraph - name of command line tool for CodeGrapg
20+
21+
```console
22+
23+
codegraph /path/to/your_python_code
24+
# path must be absolute
25+
26+
# or for one file
27+
28+
codegraph /path/to/your_python_code
29+
30+
```
31+
32+
your_python_code - module with your python code
33+
34+
For example, if I put codegraph in my user home directory path will be:
35+
36+
codegraph /Users/myuser/codegraph/codegraph
37+
38+
Pass '-o' flag if you want only print dependencies in console and don't want graph visualisation
39+
40+
codegraph /path/to/your_python_code -o
41+
42+
If you want to change view and play with graph output - you can check 'vizualyzer.py'
43+
and play with matplotlib and networkX settings.
44+
45+
In default view - red line show dependencies between entities in different modules. Green - entities in module.
46+
47+
![Graph visualisation](/docs/img/graph_visualisation.png "Graph visualisation")
48+
49+
![ Code with not used module](/docs/img/code_with_trash_module.png "Code with not used module")
50+
51+
![Code there all modules linked together](/docs/img/normal_code.png "Code there all modules linked together")
52+
53+
### TODO
54+
55+
1. Create normal readme
56+
2. Add tests
57+
3. Work on visual part of Graph (now it is not very user friendly)
58+
4. Add support to variables (names) as entities
59+
60+
## Changelog
61+
**v0.1.0**
62+
### Improvements
63+
64+
1. Command line tool name changed from 'cg' to 'codegraph'.
65+
2. Updated versions of dependencies
66+
3. Minimal supported python version up to 3.8
67+
4. Cleaned up code

README.rst

Lines changed: 0 additions & 59 deletions
This file was deleted.

build.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# till will not be released poetry plugins to get possible add custom steos in build process
2+
# https://github.com/python-poetry/poetry/pull/3733
3+
sed '/## Changelog/q' README.md > new_README.md
4+
cat CHANGELOG.txt >> new_README.md
5+
rm README.md
6+
mv new_README.md README.md
7+
m2r2 README.md
8+
mv README.rst docs/README.rst
9+
rm -r dist
10+
poetry build
11+
twine check dist/*

codegraph/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.0.5'
1+
__version__ = "0.0.5"

0 commit comments

Comments
 (0)