-
Notifications
You must be signed in to change notification settings - Fork 7
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
Code quality #12
Merged
Merged
Code quality #12
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
639f47e
Add Basic Code Quality Checks
geenen124 3db38b1
Address isort & black Issues
geenen124 3e69aed
Update Branch Name
geenen124 1e9c060
Remove Extraneous Build Job
geenen124 04aac61
Add Dev Requirements To Setup
geenen124 e5666fa
Fix Setup.py
geenen124 0c0ad96
Ignore Build Files & Artifacts
geenen124 26020f6
Address PyG Dep Installation
geenen124 6ec0974
WIP Flake8 Changes
geenen124 2ca4807
Address Remainder Of Flake8 Errors
geenen124 4ee1cd9
Address isort Issues
geenen124 61f57d0
Bump Dev Versions
geenen124 2365abe
Merge branch 'test-coverage' into code-quality
sachinsharma9780 5b30ba2
adding typings
sachinsharma9780 e8c0258
Delete .DS_Store
sachinsharma9780 0929546
adding typings and code refactor
sachinsharma9780 5adb33c
:Merge branch 'code-quality' of https://github.com/arangoml/fastgraph…
sachinsharma9780 2722a70
Delete .DS_Store
sachinsharma9780 306e104
adding typings and code refactor
sachinsharma9780 c15e713
code refactor
sachinsharma9780 c47fd45
code refactor
sachinsharma9780 69d7d09
code refactor
sachinsharma9780 fcdf959
code refactor
sachinsharma9780 1ac5403
code refactor
sachinsharma9780 fc3cd22
code refactor
sachinsharma9780 c223947
Delete .DS_Store
sachinsharma9780 d9a5d9e
workflow updates
cw00dw0rd 9427015
resolves merge conflicts for workflow and typings
cw00dw0rd b6ed995
merge and ignore rule update
cw00dw0rd 63c99be
updates runner
cw00dw0rd 8900c39
updates runner
cw00dw0rd d2bbd50
updates runner
cw00dw0rd 8cdb3fe
updates runner
cw00dw0rd 918e9a8
updates runner
cw00dw0rd d5e9b00
removes assert to resolve #13 adds exception, updates optional typings
cw00dw0rd e49260d
removes type: ignore
cw00dw0rd c2991d0
reduces python versions for workflow testing
cw00dw0rd 53eb32d
Update fastgraphml/graph_embeddings/models/dmgi.py
sachinsharma9780 069a595
code refactor
sachinsharma9780 20fe6b3
code refactor
sachinsharma9780 73c1633
Update tests/conftest.py
sachinsharma9780 bdfa880
code refactor
sachinsharma9780 eaf5e2b
code refactor
sachinsharma9780 eb8b4e3
code refactor
sachinsharma9780 f22441e
code refactor
sachinsharma9780 2bcd8cf
code refactor
sachinsharma9780 91e3b1f
added new database fastgraphml for testing
sachinsharma9780 364c496
fixing cuda error
sachinsharma9780 ee5a00e
adding conda run
sachinsharma9780 dca51f4
Update build.yml
cw00dw0rd 4813254
Update build.yml
cw00dw0rd 1abdf54
Merge branch 'code-quality' of https://github.com/arangoml/fastgraphm…
sachinsharma9780 b61ca45
code refactor
sachinsharma9780 3a7f081
code refactor
sachinsharma9780 b7e6229
Update build.yml
cw00dw0rd 4734c5c
Update build.yml
cw00dw0rd 5a9020d
Update setup.cfg
cw00dw0rd 9bce915
Update setup.cfg
cw00dw0rd 0da6502
Update build.yml
cw00dw0rd 08baac6
Update build.yml
cw00dw0rd 6d008b3
Update build.yml
cw00dw0rd 0bdc32e
Update build.yml
cw00dw0rd cbb499c
adds strict versioning for dependencies
cw00dw0rd eae9253
formatting fix
cw00dw0rd 6ce2d9a
formatting fix
cw00dw0rd 0ac0a80
re-raises exception
cw00dw0rd 29250bb
adds release workflow and updates conda env
cw00dw0rd 621aa2a
removes dist folder and adds to gitignore
cw00dw0rd 38419f0
updates install instructions
cw00dw0rd 2577c7f
updates examples to use datasets package
cw00dw0rd 4e02aba
adds arango_datasets package
cw00dw0rd daa3fff
removes exceptions class in favor of base Exceptions
cw00dw0rd 22b67b4
removes exceptions class in favor of base Exceptions
cw00dw0rd 273625c
adds arango_datasets dependency
cw00dw0rd e2bbe31
adds test for similarity search exception
cw00dw0rd b2a3dd7
fixes test password
cw00dw0rd 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
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,155 @@ | ||
name: release | ||
on: | ||
workflow_dispatch: | ||
release: | ||
types: [published] | ||
env: | ||
PACKAGE_DIR: fastgraphml | ||
TESTS_DIR: tests | ||
CONDA_ENV: fastgraphml | ||
jobs: | ||
lint: | ||
runs-on: self-hosted | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python: ["3.8"] | ||
name: Lint - Python ${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Activating conda env | ||
run: | | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
conda activate ${{env.CONDA_ENV}} | ||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install packages | ||
run: conda run -n ${{env.CONDA_ENV}} pip install .[dev] | ||
- name: Run black | ||
run: conda run -n ${{env.CONDA_ENV}} black --check --verbose --diff --color ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}} | ||
- name: Run flake8 | ||
run: conda run -n ${{env.CONDA_ENV}} flake8 ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}} | ||
- name: Run isort | ||
run: conda run -n ${{env.CONDA_ENV}} isort --check --profile=black ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}} | ||
- name: Run mypy | ||
run: conda run -n ${{env.CONDA_ENV}} mypy ${{env.PACKAGE_DIR}} ${{env.TESTS_DIR}} | ||
- name: Run bandit | ||
run: conda run -n ${{env.CONDA_ENV}} bandit --exclude "./tests/*" --recursive ./ | ||
test: | ||
needs: lint | ||
runs-on: self-hosted | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
matrix: | ||
python: ["3.8"] | ||
name: Test - Python ${{ matrix.python }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup Python ${{ matrix.python }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Activating conda env | ||
run: | | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
conda activate ${{env.CONDA_ENV}} | ||
- name: Install packages | ||
run: conda run -n ${{env.CONDA_ENV}} pip install .[dev] | ||
- name: Run pytest | ||
run: conda run -n ${{env.CONDA_ENV}} pytest --cov=${{env.PACKAGE_DIR}} --cov-report xml --cov-report term-missing -v --color=yes --no-cov-on-fail --code-highlight=yes --cov-fail-under=75 | ||
release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
name: Release package | ||
steps: | ||
- name: Activating conda env | ||
run: | | ||
source ~/miniconda3/etc/profile.d/conda.sh | ||
conda activate ${{env.CONDA_ENV}} | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Fetch complete history for all tags and branches | ||
run: git fetch --prune --unshallow | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Install release packages | ||
run: conda run -n ${{env.CONDA_ENV}} pip install setuptools wheel twine setuptools-scm[toml] | ||
|
||
- name: Install packages | ||
run: conda run -n ${{env.CONDA_ENV}} pip install .[dev] | ||
|
||
- name: Build distribution | ||
run: conda run -n ${{env.CONDA_ENV}} python setup.py sdist bdist_wheel | ||
|
||
- name: Publish to PyPI Test | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }} | ||
run: conda run -n ${{env.CONDA_ENV}} twine upload --repository testpypi dist/* #--skip-existing | ||
- name: Publish to PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} | ||
run: conda run -n ${{env.CONDA_ENV}} twine upload --repository pypi dist/* #--skip-existing | ||
|
||
changelog: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
name: Update Changelog | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Create new branch | ||
run: git checkout -b actions/changelog | ||
|
||
- name: Set branch upstream | ||
run: git push -u origin actions/changelog | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Install release packages | ||
run: conda run -n ${{env.CONDA_ENV}} pip install wheel gitchangelog pystache | ||
|
||
- name: Set variables | ||
run: echo "VERSION=$(curl ${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/latest | python -c "import sys; import json; print(json.load(sys.stdin)['tag_name'])")" >> $GITHUB_ENV | ||
|
||
- name: Generate newest changelog | ||
run: gitchangelog ${{env.VERSION}} > CHANGELOG.md | ||
|
||
- name: Make commit for auto-generated changelog | ||
uses: EndBug/add-and-commit@v7 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
add: "CHANGELOG.md" | ||
branch: actions/changelog | ||
message: "!gitchangelog" | ||
|
||
- name: Create pull request for the auto generated changelog | ||
run: | | ||
echo "PR_URL=$(gh pr create \ | ||
--title "changelog: release ${{env.VERSION}}" \ | ||
--body "beep boop, i am a robot" \ | ||
--label documentation)" >> $GITHUB_ENV | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Alert developer of open PR | ||
run: echo "Changelog $PR_URL is ready to be merged by developer." |
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,2 +1,6 @@ | ||
__pycache__/ | ||
build/ | ||
fastgraphml.egg-info/ | ||
fastgraphml/.DS_Store | ||
dist/ | ||
|
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,33 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/psf/black | ||
rev: 22.8.0 | ||
hooks: | ||
- id: black | ||
args: | ||
- -l 88 | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v0.982" | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [types-requests] | ||
exclude: ^tests/ | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
args: | ||
- "--max-line-length=88" | ||
- "--ignore=E203, W503, E251" | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.7.4 | ||
hooks: | ||
- id: bandit | ||
exclude: ^tests/ |
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 |
---|---|---|
@@ -1,4 +1,8 @@ | ||
from arango_datasets.datasets import Datasets | ||
|
||
from fastgraphml.graph_embeddings.models.dmgi import DMGI | ||
from fastgraphml.graph_embeddings.models.gat import GAT | ||
from fastgraphml.graph_embeddings.models.graph_sage import SAGE | ||
from fastgraphml.graph_embeddings.models.gat import GAT | ||
from fastgraphml.graph_embeddings.models.metapath2vec import METAPATH2VEC | ||
from fastgraphml.graph_embeddings.models.dmgi import DMGI | ||
|
||
__all__ = ["DMGI", "GAT", "SAGE", "METAPATH2VEC", "Datasets"] |
Oops, something went wrong.
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.
Consider explicitly declaring the dependencies that need to be installed - after a single run, if these are already present in the conda package cache then they won't be downloaded again
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.
After activating, we still run the pip install, which is done within the conda env and uses any cached packages. This seems sufficient or do you suggest something else?