Skip to content

Commit

Permalink
refactor: pyproject.toml to poetry (#36)
Browse files Browse the repository at this point in the history
* refactor: pyproject.toml to poetry

* fix: update pytest.yaml
  • Loading branch information
MyuddinKhatri authored Jul 30, 2024
1 parent e8a1936 commit d78328c
Show file tree
Hide file tree
Showing 5 changed files with 653 additions and 27 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/backport.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Backport
on:
pull_request_target:
types:
- closed
- labeled

jobs:
backport:
name: Backport
runs-on: ubuntu-latest
# Only react to merged PRs for security reasons.
# See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target.
if: >
github.event.pull_request.merged
&& (
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport')
)
)
steps:
- uses: tibdex/backport@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
13 changes: 12 additions & 1 deletion .github/workflows/pytest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Install JS Dependencies
run: yarn --prefer-offline

Expand All @@ -81,4 +84,12 @@ jobs:
working-directory: /home/runner/frappe-bench
run: |
source env/bin/activate
pytest ./apps/electronic_payments/electronic_payments/tests/ --disable-warnings -s
cd apps/electronic_payments
poetry install
pytest --cov=electronic_payments --cov-report=xml --disable-warnings -s | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: /home/runner/frappe-bench/apps/electronic_payments/pytest-coverage.txt
pytest-xml-coverage-path: /home/runner/frappe-bench/apps/electronic_payments/coverage.xml
26 changes: 15 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: 'frappe.*'
files: 'electronic_payments.*'
exclude: '.*json$|.*txt$|.*csv|.*md|.*svg'
- id: check-yaml
- id: no-commit-to-branch
Expand Down Expand Up @@ -38,12 +38,12 @@ repos:
# Ignore any files that might contain jinja / bundles
exclude: |
(?x)^(
frappe/public/dist/.*|
electronic_payments/public/dist/.*|
.*node_modules.*|
.*boilerplate.*|
frappe/www/website_script.js|
frappe/templates/includes/.*|
frappe/public/js/lib/.*
electronic_payments/www/website_script.js|
electronic_payments/templates/includes/.*|
electronic_payments/public/js/lib/.*
)$
- repo: https://github.com/PyCQA/flake8
Expand All @@ -52,14 +52,18 @@ repos:
- id: flake8
additional_dependencies: ['flake8-bugbear']

- repo: local
- repo: https://github.com/agritheory/test_utils
rev: v0.14.1
hooks:
- id: update_pre_commit_config
- id: validate_copyright
files: '\.(js|ts|py|md)$'
args: ["--app", "electronic_payments"]
- id: clean_customized_doctypes
args: ["--app", "electronic_payments"]
- id: validate_customizations
always_run: true
name: .github/validate_customizations.py
entry: python .github/validate_customizations.py
language: system
types: [python]
- id: validate_python_dependencies
- id: validate_javascript_dependencies

ci:
autoupdate_schedule: weekly
Expand Down
Loading

1 comment on commit d78328c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py10100% 
customize.py20200%1–2, 4, 7–8, 16–21, 26–32, 44–45
hooks.py180100% 
install.py41410%1–2, 5–7, 10, 21–24, 27–28, 31, 40, 42–43, 46–47, 50–57, 59–67, 71, 73–76, 78
config
   __init__.py00100% 
   desktop.py330%1, 4–5
   docs.py220%11–12
electronic_payments
   __init__.py00100% 
electronic_payments/doctype
   __init__.py00100% 
electronic_payments/doctype/electronic_payment_profile
   __init__.py00100% 
   electronic_payment_profile.py9455%13–16
   test_electronic_payment_profile.py30100% 
electronic_payments/doctype/electronic_payment_settings
   __init__.py00100% 
   authorize.py4854585%36–38, 40–41, 44, 47, 50–51, 53–57, 59–61, 63–71, 73, 75, 77–78, 81–87, 89–93, 98–102, 104–107, 109–110, 112–113, 115–117, 123, 129, 134, 137, 139, 141, 143–144, 147–150, 152–154, 159–161, 163–166, 168–170, 173–174, 178–180, 182–202, 204–205, 207–210, 212–213, 215, 217–218, 221–222, 225–229, 231–233, 236, 238, 241–244, 247–249, 251–254, 256–257, 267–268, 282, 284–285, 287, 289–291, 293–297, 299–309, 311–320, 322–323, 325–328, 330–331, 333, 335–345, 347, 351–352, 355–361, 363–365, 367, 369–371, 374–376, 378, 380–385, 389, 391–394, 396–400, 402–404, 406–408, 410–411, 413–416, 421, 425–428, 430–432, 434, 437, 442, 448, 454, 459–460, 462, 466, 468, 470, 472–473, 476–477, 479–480, 482, 484, 486–490, 495–498, 500–504, 506–509, 511–512, 514, 516–518, 524, 530, 535, 538, 540, 542, 544–545, 559–561, 564–566, 573–574, 576–577, 579, 581–584, 587–596, 598, 600–605, 607–608, 610–612, 614, 616–618, 622, 626–627, 629, 631, 634, 636, 638, 640–641, 644–645, 647–649, 651–652, 654–656, 658–659, 661–663, 667, 671–672, 674, 676, 679, 681, 683, 685–686, 707, 709–711, 713, 715, 717–718, 720–723, 730–732, 741, 743, 745–746, 748, 750, 752–753, 757, 762, 764–765, 768–772, 774–776, 778–779, 784, 788, 793, 796–799, 801–802, 804, 806–807, 812, 816–822, 824–829, 831–832, 834–835, 837–840, 845, 847–848
   authorizenet_reports.py00100% 
   common.py1722287%60, 71, 92, 214, 372, 376, 399–409, 411–413, 415, 425
   electronic_payment_settings.py563242%38–41, 46–53, 58–61, 63, 79, 84–85, 87–90, 92–94, 96, 118–119, 121, 131
   stripe.py3333058%60–62, 64, 69–70, 72–76, 78–79, 81, 83–84, 86–94, 96, 98, 100–101, 104, 122, 125–129, 131, 140, 143, 155, 157–161, 164–166, 170–172, 176–179, 192, 199–203, 206–208, 211–222, 226, 238–240, 243–244, 246–247, 253, 255, 257–261, 264–266, 269–274, 276–285, 288–289, 292–294, 304–305, 319, 321, 325–328, 330, 339, 342, 351–356, 359–361, 363–368, 370–372, 374–376, 379–382, 384, 387–388, 390–391, 393, 395–398, 402–406, 408–410, 412–421, 423, 426–427, 430–436, 438–440, 442, 444–451, 454–457, 459, 461, 463–469, 473, 482–483, 488, 492–494, 497–498, 500–501, 507, 509–516, 524–525, 527–529, 533, 535–536, 538, 540–547, 551, 555, 559, 561–562, 565–575, 579, 584, 587–591, 593, 597–603, 618, 620, 625, 628, 630–631, 634–636, 638–640, 643–653
   test_electronic_payment_settings.py30100% 
electronic_payments/doctype/portal_payment_method
   __init__.py00100% 
   portal_payment_method.py19478%24–26, 29
overrides
   journal_entry.py110100% 
   payment_schedule.py32196%24
templates
   __init__.py00100% 
templates/pages
   __init__.py00100% 
   order.py34340%4–5, 7, 9, 14, 16–20, 22–23, 29–31, 35–36, 39, 44–45, 52–59, 64–66, 76–78
tests
   conftest.py23291%25–26
   test_common_funcs.py5490100% 
www
   __init__.py00100% 
   me.py550%1, 4–6, 8
www/payment_methods
   __init__.py00100% 
   index.py60600%1–4, 6, 9–11, 14–18, 22–23, 25–27, 30–32, 35–37, 39–40, 42–43, 46, 49–50, 52–56, 59–60, 62–64, 67–71, 73–79, 81–84, 86–87, 89
   new_payment_method.py32320%1–4, 9, 12–16, 19–22, 24, 26–27, 29–32, 34–37, 39–40, 42–44, 46–47
   payment_method.py39390%1–4, 9, 12–16, 18–19, 21–22, 24–25, 28, 30–33, 35, 37–38, 41–44, 46–47, 49–52, 55–59
www/payments
   __init__.py28280%1–2, 5–13, 16–22, 25–32, 34–35
   index.py59590%1–2, 4, 7, 13, 16–18, 20–25, 28, 30–38, 41–42, 46, 59–60, 63–66, 69, 77, 80–81, 89–94, 96–100, 103–104, 107, 112–114, 119–121, 123, 125
TOTAL2037115143% 

Please sign in to comment.