From fa2dd52c3307717d6e4490616ab31f5a35e4e898 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Fri, 14 Jul 2023 16:30:13 -0700 Subject: [PATCH 1/3] Disable Python for temporarily --- .github/workflows/pr-check.yml | 148 ++++++++++++++++----------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 2bfd39d..918c21c 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -24,31 +24,31 @@ jobs: - name: Lint uses: ./.github/actions/lint - python-tests: - name: Python Tests - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Use Python ${{ matrix.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - name: Update pip, install wheel and nox - run: python -m pip install -U pip wheel nox - shell: bash - - - name: Run tests - run: python -m nox --session tests - shell: bash + # python-tests: + # name: Python Tests + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest] + # python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: Use Python ${{ matrix.python }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python }} + + # - name: Update pip, install wheel and nox + # run: python -m pip install -U pip wheel nox + # shell: bash + + # - name: Run tests + # run: python -m nox --session tests + # shell: bash dotnet-tests: name: Dotnet Tests @@ -90,52 +90,52 @@ jobs: env: LSP_TEST_DATA_PATH: ${{ github.workspace }}/packages/testdata - smoke-tests: - name: Smoke Tests (pygls) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - python: ['3.7', '3.8', '3.9', '3.10', '3.11'] - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Checkout Pygls - uses: actions/checkout@v3 - with: - repository: openlawlibrary/pygls - path: smoke_tests - - - name: Use Python ${{ matrix.python }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python }} - - - name: Update pip, install wheel - run: python -m pip install -U pip wheel - shell: bash - - - name: Install pip pygls dependencies - run: python -m pip install typeguard mock pytest pytest-asyncio - shell: bash - - - name: Install pip lsprotocol dependencies - run: python -m pip install -r ./packages/python/requirements.txt - shell: bash - - - name: Install pygls - run: python -m pip install --no-deps ./smoke_tests - shell: bash - - - name: Pip List - run: python -m pip list - shell: bash - - - name: Run Tests - run: python -m pytest smoke_tests/tests - env: - PYTHONPATH: ./packages/python - shell: bash + # smoke-tests: + # name: Smoke Tests (pygls) + # runs-on: ${{ matrix.os }} + # strategy: + # fail-fast: false + # matrix: + # os: [ubuntu-latest, windows-latest] + # python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + + # - name: Checkout Pygls + # uses: actions/checkout@v3 + # with: + # repository: openlawlibrary/pygls + # path: smoke_tests + + # - name: Use Python ${{ matrix.python }} + # uses: actions/setup-python@v4 + # with: + # python-version: ${{ matrix.python }} + + # - name: Update pip, install wheel + # run: python -m pip install -U pip wheel + # shell: bash + + # - name: Install pip pygls dependencies + # run: python -m pip install typeguard mock pytest pytest-asyncio + # shell: bash + + # - name: Install pip lsprotocol dependencies + # run: python -m pip install -r ./packages/python/requirements.txt + # shell: bash + + # - name: Install pygls + # run: python -m pip install --no-deps ./smoke_tests + # shell: bash + + # - name: Pip List + # run: python -m pip list + # shell: bash + + # - name: Run Tests + # run: python -m pytest smoke_tests/tests + # env: + # PYTHONPATH: ./packages/python + # shell: bash From 852fba12b8349600e85002ddd7e4a834b1bfd5a9 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 17 Jul 2023 12:08:49 -0700 Subject: [PATCH 2/3] Restore other tests --- .github/workflows/pr-check.yml | 148 ++++++++++++++++----------------- 1 file changed, 74 insertions(+), 74 deletions(-) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 918c21c..2bfd39d 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -24,31 +24,31 @@ jobs: - name: Lint uses: ./.github/actions/lint - # python-tests: - # name: Python Tests - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, windows-latest] - # python: ['3.7', '3.8', '3.9', '3.10', '3.11'] - - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: Use Python ${{ matrix.python }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python }} - - # - name: Update pip, install wheel and nox - # run: python -m pip install -U pip wheel nox - # shell: bash - - # - name: Run tests - # run: python -m nox --session tests - # shell: bash + python-tests: + name: Python Tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Use Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Update pip, install wheel and nox + run: python -m pip install -U pip wheel nox + shell: bash + + - name: Run tests + run: python -m nox --session tests + shell: bash dotnet-tests: name: Dotnet Tests @@ -90,52 +90,52 @@ jobs: env: LSP_TEST_DATA_PATH: ${{ github.workspace }}/packages/testdata - # smoke-tests: - # name: Smoke Tests (pygls) - # runs-on: ${{ matrix.os }} - # strategy: - # fail-fast: false - # matrix: - # os: [ubuntu-latest, windows-latest] - # python: ['3.7', '3.8', '3.9', '3.10', '3.11'] - - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - - # - name: Checkout Pygls - # uses: actions/checkout@v3 - # with: - # repository: openlawlibrary/pygls - # path: smoke_tests - - # - name: Use Python ${{ matrix.python }} - # uses: actions/setup-python@v4 - # with: - # python-version: ${{ matrix.python }} - - # - name: Update pip, install wheel - # run: python -m pip install -U pip wheel - # shell: bash - - # - name: Install pip pygls dependencies - # run: python -m pip install typeguard mock pytest pytest-asyncio - # shell: bash - - # - name: Install pip lsprotocol dependencies - # run: python -m pip install -r ./packages/python/requirements.txt - # shell: bash - - # - name: Install pygls - # run: python -m pip install --no-deps ./smoke_tests - # shell: bash - - # - name: Pip List - # run: python -m pip list - # shell: bash - - # - name: Run Tests - # run: python -m pytest smoke_tests/tests - # env: - # PYTHONPATH: ./packages/python - # shell: bash + smoke-tests: + name: Smoke Tests (pygls) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + python: ['3.7', '3.8', '3.9', '3.10', '3.11'] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Checkout Pygls + uses: actions/checkout@v3 + with: + repository: openlawlibrary/pygls + path: smoke_tests + + - name: Use Python ${{ matrix.python }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python }} + + - name: Update pip, install wheel + run: python -m pip install -U pip wheel + shell: bash + + - name: Install pip pygls dependencies + run: python -m pip install typeguard mock pytest pytest-asyncio + shell: bash + + - name: Install pip lsprotocol dependencies + run: python -m pip install -r ./packages/python/requirements.txt + shell: bash + + - name: Install pygls + run: python -m pip install --no-deps ./smoke_tests + shell: bash + + - name: Pip List + run: python -m pip list + shell: bash + + - name: Run Tests + run: python -m pytest smoke_tests/tests + env: + PYTHONPATH: ./packages/python + shell: bash From 21cb69b4aed66f10e23e38ccd6d59d4f39ed2896 Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 17 Jul 2023 16:10:21 -0700 Subject: [PATCH 3/3] Improve documentation tags in generated code --- generator/plugins/dotnet/dotnet_helpers.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/generator/plugins/dotnet/dotnet_helpers.py b/generator/plugins/dotnet/dotnet_helpers.py index 5b4f39b..5d83351 100644 --- a/generator/plugins/dotnet/dotnet_helpers.py +++ b/generator/plugins/dotnet/dotnet_helpers.py @@ -6,15 +6,28 @@ from generator import model +BASIC_LINK_RE = re.compile(r"{@link +(\w+) ([\w ]+)}") +BASIC_LINK_RE2 = re.compile(r"{@link +(\w+)\.(\w+) ([\w \.`]+)}") +BASIC_LINK_RE3 = re.compile(r"{@link +(\w+)}") +BASIC_LINK_RE4 = re.compile(r"{@link +(\w+)\.(\w+)}") PARTS_RE = re.compile(r"(([a-z0-9])([A-Z]))") +def _fix_links(line: str) -> str: + line = BASIC_LINK_RE.sub(r'\2', line) + line = BASIC_LINK_RE2.sub(r'\3', line) + line = BASIC_LINK_RE3.sub(r'', line) + line = BASIC_LINK_RE4.sub(r'', line) + return line + + def lines_to_doc_comments(lines: List[str]) -> List[str]: if not lines: return [] + return ( ["/// "] - + [f"/// {line}" for line in lines if not line.startswith("@")] + + [f"/// {_fix_links(line)}" for line in lines if not line.startswith("@")] + ["/// "] )