diff --git a/.github/workflows/PyTest.yml b/.github/workflows/PyTest.yml new file mode 100644 index 0000000..591e51a --- /dev/null +++ b/.github/workflows/PyTest.yml @@ -0,0 +1,29 @@ +name: Run PyTest + +on: + pull_request: + types: [opened, synchronize, reopened] + branches: ['dev', 'main'] + push: + branches: ['main'] + +jobs: + test-and-lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up PDM + uses: pdm-project/setup-pdm@v4.1 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + pdm install -d -G testing + pdm add pytest flake8 + + - name: Lint with flake8 + run: | + pdm run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude=.venv + pdm run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=.venv diff --git a/CHANGELOG.md b/CHANGELOG.md index dce2a8f..54cf07a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [2.1.3](https://github.com/c3g/project_tracking_cli/compare/2.1.2...2.1.3) + +- Debug + adding linting to Actions [`31a0f18`](https://github.com/c3g/project_tracking_cli/commit/31a0f18bfb3e0ead40caf0e2d7f7fe9cf0b7a89b) + +#### [2.1.2](https://github.com/c3g/project_tracking_cli/compare/2.1.1...2.1.2) + +> 24 January 2025 + +- [create-pull-request] automated change [`d1327c6`](https://github.com/c3g/project_tracking_cli/commit/d1327c68e7b365ddb33cc642f0397090f35ac7ca) +- Adding missing undelete and undeprecate [`3f899b7`](https://github.com/c3g/project_tracking_cli/commit/3f899b787073fbfb2d6361ebc9e4278d66cd4fed) + #### [2.1.1](https://github.com/c3g/project_tracking_cli/compare/2.1.0...2.1.1) +> 12 November 2024 + +- [create-pull-request] automated change [`6c76cde`](https://github.com/c3g/project_tracking_cli/commit/6c76cdefa78f83a9cb4c6683ac04b0c9192d8e78) - Updating to a maintained release action as the previous one was not maintained anymore [`57622a1`](https://github.com/c3g/project_tracking_cli/commit/57622a12e0d5cb2dc2fc8a2daa1cd7a83fd2c899) #### [2.1.0](https://github.com/c3g/project_tracking_cli/compare/2.0...2.1.0) diff --git a/pt_cli/__version__.py b/pt_cli/__version__.py index 55fa725..2d31b1c 100644 --- a/pt_cli/__version__.py +++ b/pt_cli/__version__.py @@ -1 +1 @@ -__version__ = '2.1.1' +__version__ = '2.1.3' diff --git a/pt_cli/cli.py b/pt_cli/cli.py index 541268f..f0667ef 100755 --- a/pt_cli/cli.py +++ b/pt_cli/cli.py @@ -22,7 +22,9 @@ GenPipes, Edit, Delete, + UnDelete, Deprecate, + UnDeprecate, Curate ) @@ -163,7 +165,9 @@ def projects(parsed_local): Edit(connection_obj=connector_session, subparser=subparser) Delete(connection_obj=connector_session, subparser=subparser) + UnDelete(connection_obj=connector_session, subparser=subparser) Deprecate(connection_obj=connector_session, subparser=subparser) + UnDeprecate(connection_obj=connector_session, subparser=subparser) Curate(connection_obj=connector_session, subparser=subparser) shtab.add_argument_to(parser, ["-s", "--print-completion"]) diff --git a/pt_cli/connect.py b/pt_cli/connect.py index f1406e6..3776cbd 100755 --- a/pt_cli/connect.py +++ b/pt_cli/connect.py @@ -10,7 +10,6 @@ import requests import bs4 -import lxml logger = logging.getLogger(__name__) @@ -128,7 +127,7 @@ def maybe_json(self, data): return loads except json.decoder.JSONDecodeError: if isinstance(data, str): - soup = bs4.BeautifulSoup(data, features="lxml") + soup = bs4.BeautifulSoup(data, features="html5lib") if soup.get_text().startswith("----------"): sys.stdout.write(soup.get_text()) elif soup.get_text().startswith("Welcome"): diff --git a/pyproject.toml b/pyproject.toml index 3f7f7fd..9c270ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "pyyaml>=6.0", "requests>=2.28", "beautifulsoup4>=4.12", - "lxml", + "html5lib", "shtab", ]