-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from madeddie/31-refactor-code-to-have-session…
…-client-and-ui-components Switch to rye and ruff
- Loading branch information
Showing
10 changed files
with
171 additions
and
64 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: eifinger/setup-rye@v3 | ||
id: setup-rye | ||
with: | ||
enable-cache: true | ||
cache-prefix: ${{ matrix.python-version }} | ||
- name: pin python-version ${{ matrix.python-version }} | ||
if: steps.setup-rye.outputs.cache-hit != 'true' | ||
run: rye pin ${{ matrix.python-version }} | ||
- name: install dependencies | ||
if: steps.setup-rye.outputs.cache-hit != 'true' | ||
run: | | ||
rye sync --no-lock | ||
- name: run ruff | ||
uses: chartboost/ruff-action@v1 | ||
- name: run tests | ||
run: | | ||
echo '```' > pytest.log | ||
rye test | tee -a pytest.log | ||
echo '```' >> pytest.log | ||
- name: PR comment pytest output | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
filePath: pytest.log | ||
if: github.event_name == 'pull_request' |
This file was deleted.
Oops, something went wrong.
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,9 +1,13 @@ | ||
# python dev objects | ||
# python generated files | ||
__pycache__/ | ||
*.py[oc] | ||
build/ | ||
dist/ | ||
wheels/ | ||
*.egg-info | ||
|
||
# venv | ||
.venv | ||
__pycache__ | ||
|
||
# local testing objects | ||
*.json | ||
cookies.txt | ||
# testing files | ||
.coverage | ||
.envrc |
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 @@ | ||
3.12.3 |
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,39 @@ | ||
[project] | ||
name = "tyora" | ||
version = "0.1.0" | ||
description = "CLI to interact with the mooc.fi instance of CSES" | ||
license = "MIT" | ||
authors = [ | ||
{ name = "Edwin Hermans", email = "[email protected]" } | ||
] | ||
dependencies = [ | ||
"html2text>=2024.2.26", | ||
"htmlement>=2.0.0", | ||
"requests>=2.32.1", | ||
] | ||
readme = "README.md" | ||
requires-python = ">= 3.12" | ||
|
||
[project.scripts] | ||
"tyora" = "tyora:main" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.rye] | ||
managed = true | ||
dev-dependencies = [ | ||
"pytest>=8.2.1", | ||
"requests-mock>=1.12.1", | ||
"pytest-cov>=5.0.0", | ||
] | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["src/tyora"] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov" |
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,38 @@ | ||
# generated by rye | ||
# use `rye lock` or `rye sync` to update this lockfile | ||
# | ||
# last locked with the following flags: | ||
# pre: false | ||
# features: [] | ||
# all-features: false | ||
# with-sources: false | ||
# generate-hashes: false | ||
|
||
-e file:. | ||
certifi==2024.2.2 | ||
# via requests | ||
charset-normalizer==3.3.2 | ||
# via requests | ||
coverage==7.5.1 | ||
# via pytest-cov | ||
html2text==2024.2.26 | ||
# via tyora | ||
htmlement==2.0.0 | ||
# via tyora | ||
idna==3.7 | ||
# via requests | ||
iniconfig==2.0.0 | ||
# via pytest | ||
packaging==24.0 | ||
# via pytest | ||
pluggy==1.5.0 | ||
# via pytest | ||
pytest==8.2.1 | ||
# via pytest-cov | ||
pytest-cov==5.0.0 | ||
requests==2.32.1 | ||
# via requests-mock | ||
# via tyora | ||
requests-mock==1.12.1 | ||
urllib3==2.2.1 | ||
# via requests |
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,25 @@ | ||
# generated by rye | ||
# use `rye lock` or `rye sync` to update this lockfile | ||
# | ||
# last locked with the following flags: | ||
# pre: false | ||
# features: [] | ||
# all-features: false | ||
# with-sources: false | ||
# generate-hashes: false | ||
|
||
-e file:. | ||
certifi==2024.2.2 | ||
# via requests | ||
charset-normalizer==3.3.2 | ||
# via requests | ||
html2text==2024.2.26 | ||
# via tyora | ||
htmlement==2.0.0 | ||
# via tyora | ||
idna==3.7 | ||
# via requests | ||
requests==2.32.1 | ||
# via tyora | ||
urllib3==2.2.1 | ||
# via requests |
This file was deleted.
Oops, something went wrong.
File renamed without changes.