Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
feat: include package parser developed in Semantics lab (#409)
Browse files Browse the repository at this point in the history
* Initial commit

* chore: configure template

* chore: add starter code

* build: add numpydoc as dependency

* build: add spacy as dependency

* docs: installation of poetry

* docs: use Python 3.9

* feat: store source code of classes/functions and docstrings of classes/functions/parameters

* feat: store whether parameters as assigned by position or name or both

* build(deps): bump scikit-learn from 1.0 to 1.0.1 in /package_parser (#12)

Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.0 to 1.0.1.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@1.0...1.0.1)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump spacy from 3.1.3 to 3.1.4 in /package_parser (#11)

Bumps [spacy](https://github.com/explosion/spaCy) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/explosion/spaCy/releases)
- [Commits](explosion/spaCy@v3.1.3...v3.1.4)

---
updated-dependencies:
- dependency-name: spacy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump amannn/action-semantic-pull-request (#8)

Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 3.4.2 to 3.4.6.
- [Release notes](https://github.com/amannn/action-semantic-pull-request/releases)
- [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/master/CHANGELOG.md)
- [Commits](amannn/action-semantic-pull-request@v3.4.2...v3.4.6)

---
updated-dependencies:
- dependency-name: amannn/action-semantic-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump astroid from 2.8.2 to 2.8.4 in /package_parser (#10)

Bumps [astroid](https://github.com/PyCQA/astroid) from 2.8.2 to 2.8.4.
- [Release notes](https://github.com/PyCQA/astroid/releases)
- [Changelog](https://github.com/PyCQA/astroid/blob/main/ChangeLog)
- [Commits](pylint-dev/astroid@v2.8.2...v2.8.4)

---
updated-dependencies:
- dependency-name: astroid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: remove community files that have a default

* ci: use reusable workflow to check format of PRs

* ci: update mega-linter

* ci: master -> main in mega-linter config

* feat: enhance extracted data for usage with API editor (#14)

* feat: add new fields to model

* fix: get everything running again

* feat: clean docstrings

* feat: extract imports and from-imports for modules

* fix: use qualified name of functions as key

* fix: some linter errors

* fix: remaining linter errors

* fix: duplicate imports in extracted API data

* fix: skip nested classes for now

* chore: add starting point for ontology development

* feat: handle properties correctly

Multiple functions with the same name can exist if they are marked with @Property, @x.setter, or @x.deleter. We, hence, need to refer to them by something other than their qualified name.

* feat: Python model classes for dependencies (#15)

* initial ontology commit

* 2 basic property subclass ideas

* added two more property subclasses

* moved ontology to predefined directory, fixed imports

* renamed property to dependency, added arithmetic dependency

* rework ontology model in code

* updated gitignore to ignore VSCode settings

* moved python-related changes to package_parser

* a stronger method for creating class instances instead of using a static method

* fixed potential lint error

* style: apply automatic fixes of linters

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: aserge16 <aserge16@users.noreply.github.com>

* ci: disable bandit, flake8, pylint

* build(deps): bump spacy from 3.1.4 to 3.2.0 in /package_parser (#18)

Bumps [spacy](https://github.com/explosion/spaCy) from 3.1.4 to 3.2.0.
- [Release notes](https://github.com/explosion/spaCy/releases)
- [Commits](explosion/spaCy@v3.1.4...v3.2.0)

---
updated-dependencies:
- dependency-name: spacy
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump importlib-metadata in /package_parser (#19)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 4.8.1 to 4.8.2.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/CHANGES.rst)
- [Commits](python/importlib_metadata@v4.8.1...v4.8.2)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump megalinter/megalinter from 5.0.5 to 5.2.0 (#16)

Bumps [megalinter/megalinter](https://github.com/megalinter/megalinter) from 5.0.5 to 5.2.0.
- [Release notes](https://github.com/megalinter/megalinter/releases)
- [Changelog](https://github.com/megalinter/megalinter/blob/main/CHANGELOG.md)
- [Commits](oxsecurity/megalinter@v5.0.5...v5.2.0)

---
updated-dependencies:
- dependency-name: megalinter/megalinter
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci: reusable workflow for MegaLinter

* ci: rename workflow

* build(deps): bump astroid from 2.8.4 to 2.9.0 in /package_parser (#17)

Bumps [astroid](https://github.com/PyCQA/astroid) from 2.8.4 to 2.9.0.
- [Release notes](https://github.com/PyCQA/astroid/releases)
- [Changelog](https://github.com/PyCQA/astroid/blob/main/ChangeLog)
- [Commits](pylint-dev/astroid@v2.8.4...v2.9.0)

---
updated-dependencies:
- dependency-name: astroid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* test: setup pytest (#21)

* build: add pytest as dev dependency

* test: exemplary unit test

* build: add pytest-cov as dev dependency

* chore: ignore outputs of pytest

* ci: run pytest on pull requests or pushes to main

* build: use older structure for dev dependencies

* docs: add status badge to README

* chore: remove CODEOWNERS

* ci: pass PAT to reusable MegaLinter workflow

* chore: Manual extraction of enum types and boundaries (#28)

* Manual extraction of enum types and boundaries

* style: apply automatic fixes of linters

Co-authored-by: duklin <duklin@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* chore: Ontology structure proposal (#25)

* Ontology initialization

The ontology/sklearn.ttl file contains the following elements:
* Classes:
	Class
	Parameter
		StringParameter
		NumberParameter
			IntegerParameter
			FloatParameter
* Object Properties:
	hasParameter
	isParameterOf
* Data Property:
	canBe

* dependency ontology

* A root ontology file proposal

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* Add mypy as dev dependency to pyproject.toml (#31)

Co-authored-by: Dushko Klincharov <klincarov@halicea.com>

* build: update prettier-config

* feat: Extract enums from docstring's type attribute (#30)

* Extract enums from docstring's type attribute. Write tests for enum extraction

* Fix mypy errors and change return type of Parameter.extract_enum method

* style: apply automatic fixes of linters

* Provide JSON serialization for enum sets

* Cover enum type cases suggested by Lars

* Create new class for parameter enums, add more tests for extracting parameter enums from docstring type

* remove backslashes from enum type values

* style: apply automatic fixes of linters

Co-authored-by: Dushko Klincharov <klincarov@halicea.com>
Co-authored-by: duklin <duklin@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* feat: Dependencies (#32)

* initial ontology commit

* 2 basic property subclass ideas

* added two more property subclasses

* moved ontology to predefined directory, fixed imports

* renamed property to dependency, added arithmetic dependency

* rework ontology model in code

* updated gitignore to ignore VSCode settings

* moved python-related changes to package_parser

* a stronger method for creating class instances instead of using a static method

* fixed potential lint error

* added ontology file for dependencies

* initial commit dependency fetcher

* initial code commit

* playing code for spacy rules

* some extra ontology properties for depenencies

* Dependencies extract first commit

* removed playground code

* fixed check in preprocessing

* oops, check is correct now

* removed name==main at bottom of file

* Added new instances

* Added a case of !=

* reworked preprocessing and added test

* using regex for preprocessing, cleaner, thanks Lars

* removed unused import and added type hint for dict

* type hint fixed again

* style: apply automatic fixes of linters

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: Prajakta Bhujbal <prajaktabhujbal7@gmail.com>
Co-authored-by: aserge16 <aserge16@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* build(deps): bump scikit-learn from 1.0.1 to 1.0.2 in /package_parser (#41)

Bumps [scikit-learn](https://github.com/scikit-learn/scikit-learn) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/scikit-learn/scikit-learn/releases)
- [Commits](scikit-learn/scikit-learn@1.0.1...1.0.2)

---
updated-dependencies:
- dependency-name: scikit-learn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump mypy from 0.910 to 0.930 in /package_parser (#39)

Bumps [mypy](https://github.com/python/mypy) from 0.910 to 0.930.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.910...v0.930)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump spacy from 3.2.0 to 3.2.1 in /package_parser (#37)

Bumps [spacy](https://github.com/explosion/spaCy) from 3.2.0 to 3.2.1.
- [Release notes](https://github.com/explosion/spaCy/releases)
- [Commits](explosion/spaCy@v3.2.0...v3.2.1)

---
updated-dependencies:
- dependency-name: spacy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump importlib-metadata in /package_parser (#38)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 4.8.2 to 4.10.0.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/CHANGES.rst)
- [Commits](python/importlib_metadata@v4.8.2...v4.10.0)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: Dependencies (#42)

* initial ontology commit

* 2 basic property subclass ideas

* added two more property subclasses

* moved ontology to predefined directory, fixed imports

* renamed property to dependency, added arithmetic dependency

* rework ontology model in code

* updated gitignore to ignore VSCode settings

* moved python-related changes to package_parser

* a stronger method for creating class instances instead of using a static method

* fixed potential lint error

* added ontology file for dependencies

* initial commit dependency fetcher

* initial code commit

* playing code for spacy rules

* some extra ontology properties for depenencies

* Dependencies extract first commit

* removed playground code

* fixed check in preprocessing

* oops, check is correct now

* removed name==main at bottom of file

* Added new instances

* Added a case of !=

* reworked preprocessing and added test

* using regex for preprocessing, cleaner, thanks Lars

* removed unused import and added type hint for dict

* type hint fixed again

* Modified pattern for "nominal subject (passive)" and "prepositional modifier"

* #35 used pattern created

* #36 first extraction function implemented for the first pattern

* #35 ignored condition pattern added

* #36 dependency extraction function for ignored condition pattern

* added second case of action word having uppercase first letter

* added pattern parameter applies

* fix: mypy error

* style: apply automatic fixes of linters

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: Prajakta Bhujbal <prajaktabhujbal7@gmail.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>
Co-authored-by: lars-reimann <lars-reimann@users.noreply.github.com>

* feat: Model refined types as dataclasses, introduce only one property in th… (#45)

* Model refined types as dataclasses, introduce only one property in the json output for the refined types

* style: apply automatic fixes of linters

Co-authored-by: Dushko Klincharov <klincarov@halicea.com>
Co-authored-by: duklin <duklin@users.noreply.github.com>

* build(deps): bump astroid from 2.9.0 to 2.9.1 in /package_parser (#40)

Bumps [astroid](https://github.com/PyCQA/astroid) from 2.9.0 to 2.9.1.
- [Release notes](https://github.com/PyCQA/astroid/releases)
- [Changelog](https://github.com/PyCQA/astroid/blob/main/ChangeLog)
- [Commits](pylint-dev/astroid@v2.9.0...v2.9.1)

---
updated-dependencies:
- dependency-name: astroid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* refactor: manually extracted refined types (#46)

* Refactor the manually extracted refined types for classes KMeans, PCA, TruncatedSVD, CountVectorizer and TfIdfVectorizer

* refactor refinedtypes for DecisionTreeClassifier

* refactor json for model_selection,neighbors,preprocessing,svm,tree

* refactoring for metrics,linearmodel,impute

* refactored json for feature_extraction

* updated BoundaryTypes and NamedTypes and the remaining classes

* Refactor manually extracted refined types for cluster, decomposition, ensemble

* Refactor manually extracted refined types for feature_extraction, impute and linear_model

* refactored manually extracted refined types for metrics,model_selection,neighbors,preprocessing,svm,tree

* Format the json files from the manual extraction of refined types

* Extract the boundary types in another json and the docstring part that is related to the boundary

* style: apply automatic fixes of linters

Co-authored-by: Dushko Klincharov <klincarov@halicea.com>
Co-authored-by: mmdoja <mmdoja@gmail.com>
Co-authored-by: duklin <duklin@users.noreply.github.com>

* feat: Action/Condition Classification (#48)

* #43 basic condtion and action extraction functions

* #43 corrected extractions, now matching occurs per sentence, removes many false positives

* #43 fixed recursive action extraction function

* Added new pattern

* #43 classifying of ignored parameter actions

* #43 conditions and actions are now dataclasses, renamed one condition

* #43 phrases to categories actions/conditions

* #43 mypy fixes

* style: apply automatic fixes of linters

* #43 renamed IDs in general SCONJ pattern

* #43 more descriptive pattern name

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: prajakta <prajaktabhujbal7@gmail.com>
Co-authored-by: aserge16 <aserge16@users.noreply.github.com>

* ci: smoke test (#53)

* Update pr.yml

* test: add smoke test to main workflow

* ci: use poetry run instead

* test: Dependencies unit tests (#50)

* correctly formatted models to data classes

* updated model Names and added new phrases

* #49 dependency extraction function unit tests

* style: apply automatic fixes of linters

* fix: possible fix for build error

* added json dump of dependencies to CLI flow

* mypy fix

* style: apply automatic fixes of linters

* do the versions make a difference on dependency understanding?

* updated url for spacy langauge module

* quick fix, need to work on punctuation extraction

* removed hanging punctuation when extracting actions

* style: apply automatic fixes of linters

* test for dependency extraction class subordinating_conjuction

* style: apply automatic fixes of linters

* more documentation for functions

* style: apply automatic fixes of linters

* updated ontology to represent current code state

* removed pattern without implemented function for now

* added dependency README

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: aserge16 <aserge16@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* feat: Boundary extraction (#54)

* Extract boundaries with regex

* Write tests for extracting boundaries

* Categorize boundaries

* style: apply automatic fixes of linters

Co-authored-by: Dushko Klincharov <klincarov@halicea.com>
Co-authored-by: duklin <duklin@users.noreply.github.com>

* build(deps): bump astroid from 2.9.1 to 2.9.3 in /package_parser (#58)

Bumps [astroid](https://github.com/PyCQA/astroid) from 2.9.1 to 2.9.3.
- [Release notes](https://github.com/PyCQA/astroid/releases)
- [Changelog](https://github.com/PyCQA/astroid/blob/main/ChangeLog)
- [Commits](pylint-dev/astroid@v2.9.1...v2.9.3)

---
updated-dependencies:
- dependency-name: astroid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump importlib-metadata in /package_parser (#56)

Bumps [importlib-metadata](https://github.com/python/importlib_metadata) from 4.10.0 to 4.10.1.
- [Release notes](https://github.com/python/importlib_metadata/releases)
- [Changelog](https://github.com/python/importlib_metadata/blob/main/CHANGES.rst)
- [Commits](python/importlib_metadata@v4.10.0...v4.10.1)

---
updated-dependencies:
- dependency-name: importlib-metadata
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps-dev): bump mypy from 0.930 to 0.931 in /package_parser (#55)

Bumps [mypy](https://github.com/python/mypy) from 0.930 to 0.931.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](python/mypy@v0.930...v0.931)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump numpydoc from 1.1.0 to 1.2 in /package_parser (#57)

Bumps [numpydoc](https://github.com/numpy/numpydoc) from 1.1.0 to 1.2.
- [Release notes](https://github.com/numpy/numpydoc/releases)
- [Changelog](https://github.com/numpy/numpydoc/blob/main/doc/release_notes.rst)
- [Commits](numpy/numpydoc@v1.1.0...numpydoc-1.2)

---
updated-dependencies:
- dependency-name: numpydoc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: updated ontology to represent the current model (#65)

* updated ontology to represent the current model

* fix: updated ontology

* removed subclasses for UnionType

* feat: Dependencies updated README (#59)

* corrected pattern name

* updated readme with future work

* updated readme with instructions on how to add further patterns

* expected type correction

* updated test

* refactor: possible fix for mypy error

* refactor: another possible fix for mypy error

Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>

* feat: integrate purity parser (#68)

* Initial prototype written with astroid as shown in last meeting (10.12.21)

* Update to ast file & node classes file

* Add files via upload

* Delete ast_example2.py

* Add files via upload

* State of ast visitor as discussed in meeting

* Add files via upload

* Some fixes to handlers of many ast nodes

* Added saving properties to lists for ontology integration

* Add files via upload

* Add files via upload

* Added comments, some fixes to certain nodes

* Delete PurityV1.owl

* Delete PurityV2.owl

* Add files via upload

* style: minor formatting changes

* style: apply automatic fixes of linters

Co-authored-by: Adrian Bajraktari <s6adbajr@uni-bonn.de>
Co-authored-by: BitaAfshar <93251213+BitaAfshar@users.noreply.github.com>
Co-authored-by: Lars Reimann <mail@larsreimann.com>
Co-authored-by: lars-reimann <lars-reimann@users.noreply.github.com>

* refactor: move everything into top-level folder

* refactor: remove duplicate or unnecessary files

* refactor: move api-editor files into new folder

* ci: fix paths

* build: make gradlew executable again

* build: some fixes for linter configuration

* build: re-enable ES Module interop

* style: apply automatic fixes of linters

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aleksandr Sergeev <46769243+aserge16@users.noreply.github.com>
Co-authored-by: Aleksandr Sergeev <aleksandr.sergeev@tngtech.com>
Co-authored-by: aserge16 <aserge16@users.noreply.github.com>
Co-authored-by: Dushko Klincharov <klincharovdushko@gmail.com>
Co-authored-by: duklin <duklin@users.noreply.github.com>
Co-authored-by: Dushko Klincharov <klincarov@halicea.com>
Co-authored-by: Prajakta Bhujbal <prajaktabhujbal7@gmail.com>
Co-authored-by: lars-reimann <lars-reimann@users.noreply.github.com>
Co-authored-by: mmdoja <mmdoja@gmail.com>
Co-authored-by: Adrian Bajraktari <32750210+AdrianBajraktari@users.noreply.github.com>
Co-authored-by: Adrian Bajraktari <s6adbajr@uni-bonn.de>
Co-authored-by: BitaAfshar <93251213+BitaAfshar@users.noreply.github.com>
  • Loading branch information
14 people authored Feb 10, 2022
1 parent a3b5c29 commit d31031c
Show file tree
Hide file tree
Showing 243 changed files with 8,928 additions and 61 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ updates:
schedule:
interval: 'monthly'
rebase-strategy: 'disabled'
- package-ecosystem: 'pip'
directory: '/package_parser'
schedule:
interval: 'monthly'
rebase-strategy: 'disabled'
100 changes: 100 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Main

on:
push:
branches: [main]

jobs:
build-api-editor:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api-editor

strategy:
matrix:
node-version: [16.x]
java-version: [17]

steps:
- name: Checkout source
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: api-editor/client/package-lock.json

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2.5.0
with:
distribution: temurin
java-version: ${{ matrix.java-version }}
cache: gradle

# See https://docs.github.com/en/actions/guides/building-and-testing-java-with-gradle
- name: Setup Gradle
uses: gradle/wrapper-validation-action@v1

- name: Build with Gradle
run: ./gradlew build

- name: Upload distribution
uses: actions/upload-artifact@v2
with:
name: API-Editor
path: api-editor/server/build/libs/*-all.jar
if-no-files-found: error

build-package-parser:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./package-parser
strategy:
matrix:
python-version: [3.9]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1.3.0
with:
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction

- name: Smoke test
run: poetry run parse-package api -p sklearn -o out

# Requires installation of pytest and pytest-cov
- name: Test with pytest
run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=html

- name: Upload test coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/upload-artifact@v2
with:
name: Test coverage
path: package-parser/htmlcov
46 changes: 0 additions & 46 deletions .github/workflows/master.yml

This file was deleted.

60 changes: 57 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ concurrency:
cancel-in-progress: true

jobs:
build:
build-api-editor:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api-editor

strategy:
matrix:
Expand All @@ -26,7 +29,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: client/package-lock.json
cache-dependency-path: api-editor/client/package-lock.json

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v2.5.0
Expand All @@ -47,5 +50,56 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Test report
path: server/build/reports
path: api-editor/server/build/reports
if-no-files-found: ignore

build-package-parser:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./package-parser
strategy:
matrix:
python-version: [ 3.9 ]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
uses: snok/install-poetry@v1.3.0
with:
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install library
run: poetry install --no-interaction

- name: Smoke test
run: poetry run parse-package api -p sklearn -o out

# Requires installation of pytest and pytest-cov
- name: Test with pytest
run: poetry run pytest --doctest-modules --cov=package_parser --cov-report=html

- name: Upload test coverage
if: ${{ github.actor != 'dependabot[bot]' }}
uses: actions/upload-artifact@v2
with:
name: Test coverage
path: package-parser/htmlcov
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build/
dist/
dist-ssr/

/server/src/main/resources/static/
api-editor/server/src/main/resources/static/

# Other
.DS_Store/
Expand Down
9 changes: 9 additions & 0 deletions .idea/api-editor.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules/com.larsreimann.api_editor.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ ENABLE_LINTERS:
- POWERSHELL_POWERSHELL
# - PROTOBUF_PROTOLINT
# - PUPPET_PUPPET_LINT
- PYTHON_PYLINT
# - PYTHON_PYLINT
- PYTHON_BLACK
- PYTHON_FLAKE8
# - PYTHON_FLAKE8
- PYTHON_ISORT
- PYTHON_BANDIT
# - PYTHON_BANDIT
- PYTHON_MYPY
- R_LINTR
# - RAKU_RAKU
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ build/
dist/
dist-ssr/

/server/src/main/resources/static/
api-editor/server/src/main/resources/static/
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ idea {
}
}


// Tasks ---------------------------------------------------------------------------------------------------------------

tasks.register<NpmTask>("buildClient") {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { Code, Flex, HStack, IconButton, Stack, Text } from '@chakra-ui/react';
import 'katex/dist/katex.min.css';
import React, {ClassAttributes, FunctionComponent, HTMLAttributes, useState} from 'react';
import React, {
ClassAttributes,
FunctionComponent,
HTMLAttributes,
useState,
} from 'react';
import { FaChevronDown, FaChevronRight } from 'react-icons/fa';
import ReactMarkdown from 'react-markdown';
import {
Expand All @@ -17,8 +22,8 @@ interface DocumentationTextProps {

type ParagraphComponent = FunctionComponent<
ClassAttributes<HTMLParagraphElement> &
HTMLAttributes<HTMLParagraphElement> &
ReactMarkdownProps
HTMLAttributes<HTMLParagraphElement> &
ReactMarkdownProps
>;

const CustomText: ParagraphComponent = function ({ className, children }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import remarkGfm from 'remark-gfm';
import { groupBy, isEmptyList } from '../../../common/util/listOperations';
import PythonModule from '../model/PythonModule';
import {CodeComponent} from "react-markdown/lib/ast-to-react";
import { CodeComponent } from 'react-markdown/lib/ast-to-react';

// See https://github.com/remarkjs/react-markdown#use-custom-components-syntax-highlight
// eslint-disable-next-line @typescript-eslint/no-unused-vars
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions client/tsconfig.json → api-editor/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
// TODO re-enable once https://github.com/chakra-ui/chakra-ui/issues/4226 is fixed
"esModuleInterop": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions package-parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Logs
npm-debug.log*

# Dependency directories
node_modules/

# Optional npm cache directory
.npm/

# Optional REPL history
.node_repl_history

# mega-linter reports
/report/

# Python binaries
__pycache__/
*.pyc

# Poetry distribution
dist/

# Pytest outputs
.pytest_cache/
htmlcov/
.coverage

# Output of this tool
out/

# VSCode Settings
.vscode/
13 changes: 13 additions & 0 deletions package-parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Execution of Starter Code

1. Install Python 3.9.
2. Install [poetry](https://python-poetry.org/docs/master/#installation).
3. **Only the first time**, install dependencies:
```shell
poetry install
```
4. Run the tool:
```shell
poetry shell
parse-package api -p sklearn -o out
```
Empty file.
4 changes: 4 additions & 0 deletions package-parser/package_parser/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from package_parser.main import main

if __name__ == "__main__":
main()
Loading

0 comments on commit d31031c

Please sign in to comment.