-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File restructure and Linting #103
Merged
Merged
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4453187
MAINT: Refactor directory structure
khalford d10e136
Created Github Workflow
khalford e637f65
Changed path of requirements file in workflow
khalford 19f231e
Changed path for Pytest workflow
khalford ed7f3e0
MAINT: Changed path for Pytest workflow
khalford a7c0774
MAINT: Added Pylint to requirements.txt
khalford f3e77e7
Merge remote-tracking branch 'origin/workflow' into workflow
khalford cc6d14c
Added __init__.py to all python directories.
khalford 83400f2
Linting Fixes
khalford 443eb2d
Added import error to .pylintrc
khalford 41f9b74
MAINT: Lint fix
khalford 827140b
Linting Fixes
khalford 6656bb9
Changed Pylint run command in workflow.
khalford db06705
Changed pylint to run with pylintrc path
khalford ee1c1b2
Removed DataFiles from gitignore.
khalford 5e197d1
Rename csv_things and csv_utils
khalford 2548d9f
MAINT: Type hint for u_height in netbox_create
khalford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Pynetbox Data Uploader Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths: | ||
- "Pynetbox_Data_Uploader/**" | ||
- ".github/workflows/Pynetbox.yaml" | ||
|
||
jobs: | ||
test_and_lint: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.x"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r Pynetbox_Data_Uploader/requirements.txt | ||
|
||
- name: Run tests | ||
run: cd Pynetbox_Data_Uploader && python3 -m pytest . | ||
|
||
- name: Analyse with pylint | ||
run: | | ||
cd Pynetbox_Data_Uploader && pylint $(git ls-files '*.py') --rcfile=.pylintrc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ venv/ | |
|
||
.coverage | ||
coverage.xml | ||
Netbox_CSV_Read/DataFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[FORMAT] | ||
# Black will enforce 88 chars on Python code | ||
# this will enforce 120 chars on docs / comments | ||
max-line-length=120 | ||
|
||
# Disable various warnings: | ||
# C0114: Missing module string - we don't need module strings for the small repo | ||
# C0115: Missing class doc string - a lot of the actions are self explanatory | ||
# W0511: TODOs they're well....to do later | ||
# R0801: Similar lines - Imports and method signatures will flag this, such as forwarding action args | ||
# C0116: Missing method docstring - Adds too much noise | ||
# E0401: Ignore import errors as imports work | ||
|
||
disable=C0114,C0115,E0401,W0511,R0801,C0116,E0401 |
Empty file.
Empty file.
20 changes: 10 additions & 10 deletions
20
Netbox_CSV_Read/CSV/csv_utils.py → ...Data_Uploader/lib/csv_things/csv_utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 5 additions & 4 deletions
9
Netbox_CSV_Read/CSV/format_dict.py → ...ta_Uploader/lib/csv_things/format_dict.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
2 changes: 2 additions & 0 deletions
2
Netbox_CSV_Read/Netbox_Api/netbox_connect.py → ...Uploader/lib/netbox_api/netbox_connect.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import pynetbox as nb | ||
|
||
# pylint:disable = too-few-public-methods | ||
|
||
|
||
class NetboxConnect: | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[pytest] | ||
pythonpath = lib | ||
testpaths = Tests | ||
python_files = *.py | ||
python_functions = test_* |
Binary file renamed
BIN
+72 Bytes
Netbox_CSV_Read/requirements.txt → Pynetbox_Data_Uploader/requirements.txt
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Netbox_CSV_Read/Tests/test_netbox_create.py → ...Data_Uploader/tests/test_netbox_create.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you forgot type hint for
u_height