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

feat: include package parser developed in Semantics lab #409

Merged
merged 68 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
ee37bb3
Initial commit
lars-reimann Sep 30, 2021
68ac8ab
chore: configure template
lars-reimann Sep 30, 2021
5f360a4
chore: add starter code
lars-reimann Oct 13, 2021
559a0f6
build: add numpydoc as dependency
lars-reimann Oct 18, 2021
2f0314b
build: add spacy as dependency
lars-reimann Oct 18, 2021
e3f286b
docs: installation of poetry
lars-reimann Oct 22, 2021
3bf71f9
docs: use Python 3.9
lars-reimann Oct 28, 2021
d1b4055
feat: store source code of classes/functions and docstrings of classe…
lars-reimann Oct 28, 2021
9391c2a
feat: store whether parameters as assigned by position or name or both
lars-reimann Oct 30, 2021
abd215e
build(deps): bump scikit-learn from 1.0 to 1.0.1 in /package_parser (…
dependabot[bot] Nov 2, 2021
75eccbd
build(deps): bump spacy from 3.1.3 to 3.1.4 in /package_parser (#11)
dependabot[bot] Nov 2, 2021
d1ad13f
build(deps): bump amannn/action-semantic-pull-request (#8)
dependabot[bot] Nov 2, 2021
daae4a5
build(deps): bump astroid from 2.8.2 to 2.8.4 in /package_parser (#10)
dependabot[bot] Nov 2, 2021
75e9858
docs: remove community files that have a default
lars-reimann Nov 2, 2021
87d09b7
ci: use reusable workflow to check format of PRs
lars-reimann Nov 2, 2021
dc6616f
ci: update mega-linter
lars-reimann Nov 2, 2021
cbad180
ci: master -> main in mega-linter config
lars-reimann Nov 3, 2021
a19b551
feat: enhance extracted data for usage with API editor (#14)
lars-reimann Nov 5, 2021
4fa2a05
fix: duplicate imports in extracted API data
lars-reimann Nov 5, 2021
0f5964c
fix: skip nested classes for now
lars-reimann Nov 5, 2021
92fcd4f
chore: add starting point for ontology development
lars-reimann Nov 26, 2021
6039f36
feat: handle properties correctly
lars-reimann Nov 28, 2021
130eb9c
feat: Python model classes for dependencies (#15)
aserge16 Nov 29, 2021
02d32d2
ci: disable bandit, flake8, pylint
lars-reimann Dec 3, 2021
c1f79cb
build(deps): bump spacy from 3.1.4 to 3.2.0 in /package_parser (#18)
dependabot[bot] Dec 3, 2021
9c8a592
build(deps): bump importlib-metadata in /package_parser (#19)
dependabot[bot] Dec 3, 2021
6ea3e92
build(deps): bump megalinter/megalinter from 5.0.5 to 5.2.0 (#16)
dependabot[bot] Dec 3, 2021
650df1d
ci: reusable workflow for MegaLinter
lars-reimann Dec 3, 2021
3f086fa
ci: rename workflow
lars-reimann Dec 3, 2021
b436e7b
build(deps): bump astroid from 2.8.4 to 2.9.0 in /package_parser (#17)
dependabot[bot] Dec 5, 2021
d9d3f62
test: setup pytest (#21)
lars-reimann Dec 5, 2021
be77d40
docs: add status badge to README
lars-reimann Dec 5, 2021
a21c490
chore: remove CODEOWNERS
lars-reimann Dec 13, 2021
adccbca
ci: pass PAT to reusable MegaLinter workflow
lars-reimann Dec 13, 2021
ce5e079
chore: Manual extraction of enum types and boundaries (#28)
duklin Dec 13, 2021
1c0aa64
chore: Ontology structure proposal (#25)
duklin Dec 14, 2021
82c740c
Add mypy as dev dependency to pyproject.toml (#31)
duklin Dec 15, 2021
9fd3f1b
build: update prettier-config
lars-reimann Dec 8, 2021
16fa220
feat: Extract enums from docstring's type attribute (#30)
duklin Dec 19, 2021
2ddbdbc
feat: Dependencies (#32)
aserge16 Dec 26, 2021
4bb0b2c
build(deps): bump scikit-learn from 1.0.1 to 1.0.2 in /package_parser…
dependabot[bot] Jan 1, 2022
a2fbf74
build(deps-dev): bump mypy from 0.910 to 0.930 in /package_parser (#39)
dependabot[bot] Jan 1, 2022
c85f52c
build(deps): bump spacy from 3.2.0 to 3.2.1 in /package_parser (#37)
dependabot[bot] Jan 1, 2022
e79f549
build(deps): bump importlib-metadata in /package_parser (#38)
dependabot[bot] Jan 1, 2022
c743914
feat: Dependencies (#42)
aserge16 Jan 7, 2022
4c2198b
feat: Model refined types as dataclasses, introduce only one property…
duklin Jan 14, 2022
2af8763
build(deps): bump astroid from 2.9.0 to 2.9.1 in /package_parser (#40)
dependabot[bot] Jan 14, 2022
3efa424
refactor: manually extracted refined types (#46)
duklin Jan 14, 2022
13c789c
feat: Action/Condition Classification (#48)
aserge16 Jan 17, 2022
3278c4d
ci: smoke test (#53)
lars-reimann Jan 20, 2022
60fc290
test: Dependencies unit tests (#50)
aserge16 Jan 20, 2022
d689de7
feat: Boundary extraction (#54)
duklin Jan 20, 2022
28d9feb
build(deps): bump astroid from 2.9.1 to 2.9.3 in /package_parser (#58)
dependabot[bot] Feb 1, 2022
df89cba
build(deps): bump importlib-metadata in /package_parser (#56)
dependabot[bot] Feb 1, 2022
ec703c9
build(deps-dev): bump mypy from 0.930 to 0.931 in /package_parser (#55)
dependabot[bot] Feb 1, 2022
e7049fd
build(deps): bump numpydoc from 1.1.0 to 1.2 in /package_parser (#57)
dependabot[bot] Feb 1, 2022
135c61e
feat: updated ontology to represent the current model (#65)
mmdoja Feb 7, 2022
e6e9b0e
feat: Dependencies updated README (#59)
aserge16 Feb 7, 2022
c210d05
feat: integrate purity parser (#68)
AdrianBajraktari Feb 7, 2022
35a68e3
refactor: move everything into top-level folder
lars-reimann Feb 10, 2022
a7daa4e
Merge remote-tracking branch 'api-editor/main'
lars-reimann Feb 10, 2022
b7d244a
refactor: remove duplicate or unnecessary files
lars-reimann Feb 10, 2022
c1e2569
refactor: move api-editor files into new folder
lars-reimann Feb 10, 2022
812a34f
ci: fix paths
lars-reimann Feb 10, 2022
0bf1a2a
build: make gradlew executable again
lars-reimann Feb 10, 2022
285db5d
build: some fixes for linter configuration
lars-reimann Feb 10, 2022
e730540
build: re-enable ES Module interop
lars-reimann Feb 10, 2022
3372bcc
style: apply automatic fixes of linters
lars-reimann Feb 10, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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.
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.
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