Skip to content

Commit dc05ba6

Browse files
committed
Refactor, Clean and Prepare for release
1 parent 0c4f098 commit dc05ba6

116 files changed

Lines changed: 5668 additions & 4342 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,27 @@
1-
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at http://EditorConfig.org
3-
41
root = true
5-
; Use 2 spaces for indentation in all files
2+
63
[*]
7-
end_of_line = lf
84
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
97
trim_trailing_whitespace = true
108
indent_style = space
9+
10+
[*.{py,rst,ini}]
1111
indent_size = 4
12-
insert_final_newline = true
12+
13+
[*.py]
14+
profile = black
15+
max_line_length = 100
16+
17+
[*.md]
18+
trim_trailing_whitespace = false
19+
20+
[*.yml]
21+
indent_size = 2
22+
23+
[*.{html,css,scss,json,yml,xml}]
24+
indent_size = 2
25+
26+
[Makefile]
27+
indent_style = tab
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
# yamllint disable rule:line-length
3+
name: Bug report
4+
description: Create a report to help us improve
5+
labels: ["bug"]
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
- type: textarea
13+
id: what-happened
14+
attributes:
15+
label: Describe the bug
16+
description: A clear and concise description of what the bug is.
17+
placeholder: Tell us what you see!
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: repro-steps
22+
attributes:
23+
label: To Reproduce
24+
description: Steps to reproduce the behavior
25+
placeholder: |
26+
1. Fetch a '...'
27+
2. Update the '....'
28+
3. See error
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: expected-behavior
33+
attributes:
34+
label: Expected behavior
35+
description: A clear and concise description of what you expected to happen.
36+
validations:
37+
required: true
38+
- type: textarea
39+
id: code-snippets
40+
attributes:
41+
label: Code snippets
42+
description: If applicable, add code snippets to help explain your problem.
43+
render: Python
44+
validations:
45+
required: false
46+
- type: input
47+
id: os
48+
attributes:
49+
label: OS
50+
placeholder: macOS
51+
validations:
52+
required: true
53+
- type: input
54+
id: language-version
55+
attributes:
56+
label: Language version
57+
placeholder: Python 3.10.4
58+
validations:
59+
required: true
60+
- type: input
61+
id: lib-version
62+
attributes:
63+
label: Library version
64+
placeholder: razorpay-py v1.4.2
65+
validations:
66+
required: true
67+
- type: textarea
68+
id: additional-context
69+
attributes:
70+
label: Additional context
71+
description: Add any other context about the problem here.
72+
validations:
73+
required: false
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature request
2+
description: Suggest an idea for this library
3+
labels: ["feature-request"]
4+
body:
5+
- type: markdown
6+
attributes:
7+
value: |
8+
Thanks for taking the time to fill out this feature request!
9+
- type: textarea
10+
id: problem
11+
attributes:
12+
label: Is your feature request related to a problem? Please describe.
13+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
14+
- type: textarea
15+
id: solution
16+
attributes:
17+
label: Describe the solution you'd like
18+
description: A clear and concise description of what you want to happen.
19+
- type: textarea
20+
id: alternatives
21+
attributes:
22+
label: Describe alternatives you've considered
23+
description: A clear and concise description of any alternative solutions or features you've considered.
24+
- type: textarea
25+
id: context
26+
attributes:
27+
label: Additional context
28+
description: Add any other context about the feature request here.

.github/pull_request_template.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
1-
## Note :- Please follow the below points while attaching test cases document link below:
2-
### - If label `Tested` is added then test cases document URL is mandatory.
3-
### - Link added should be a valid URL and accessible throughout the org.
4-
### - If the branch name contains hotfix / revert by default the BVT workflow check will pass.
5-
6-
| Test Case Document URL |
7-
|-----------------------------------------------|
8-
| Please paste test case document link here.... |
1+
## Goal of this PR
2+
3+
_Replace this paragraph with a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change._
4+
5+
Fixes #<issue_number_goes_here> 🦕
6+
7+
## Impact
8+
9+
- [ ] New/Updated API fields or mutations
10+
11+
## Tests
12+
13+
I added the following tests:
14+
15+
_Replace this with a list of the tests that you added as part of this PR._
16+
17+
<!-- No Test(s) added.-->
18+
19+
## Checklist
20+
21+
<!-- Please keep this section. -->
22+
23+
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process.
24+
25+
- [ ] I performed a self-review of the code.
26+
- [ ] Appropriate labels are assigned, especially labels related to type (feature, bug, etc.) and amount of change (major, minor, and patch).
27+
- [ ] New code is covered in tests.
28+
- [ ] I updated/added relevant documentation and added comments.
29+
- [ ] All Python code is formatted and linted using ruff and other linting tools available in the project.
30+
- [ ] All existing and new tests are passing.

.github/workflows/ci.yml

Lines changed: 90 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,125 @@
1+
---
12
name: CI
2-
on:
3+
4+
on: # yamllint disable
5+
workflow_dispatch: {}
36
push:
47
branches:
58
- master
9+
- beta
10+
- sdk-release/**
11+
- feature/**
612
tags:
713
- v[0-9]+.[0-9]+.[0-9]+*
814
pull_request:
915
branches:
1016
- master
17+
- beta
18+
- sdk-release/**
19+
- feature/**
20+
1121
jobs:
22+
lint:
23+
name: Static Checks
24+
runs-on: "ubuntu-24.04"
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Set up Python 3
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: "3.13"
31+
- name: Install dev dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements/base.txt -r requirements/dev.txt
35+
# - name: check mypy
36+
# run: mypy .
37+
- name: check linting
38+
run: ruff check .
39+
- name: check formatting
40+
run: ruff format --check
41+
1242
build:
1343
name: Build
14-
runs-on: ubuntu-latest
44+
runs-on: "ubuntu-24.04"
1545
steps:
16-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
47+
1748
- name: Set up Python 3
18-
uses: actions/setup-python@v3
49+
uses: actions/setup-python@v4
1950
with:
20-
python-version: "3.10"
21-
- name: Install dependencies
51+
python-version: "3.13"
52+
53+
- name: Install dev dependencies
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install -r requirements/base.txt -r requirements/dev.txt
57+
58+
- name: Build and check package
2259
run: |
23-
python -m pip install --upgrade pip
24-
pip install build
2560
python -m build
26-
python -m pip install --upgrade twine
27-
python -m twine check dist/*
28-
29-
- name: 'Upload Artifact'
30-
uses: actions/upload-artifact@v2
61+
62+
- name: "Upload Artifact"
63+
uses: actions/upload-artifact@v4
3164
with:
3265
name: dist
33-
path: dist/
66+
path: dist/
67+
3468
test:
35-
name: Test Coverage
36-
needs: build
37-
runs-on: ubuntu-latest
69+
runs-on: ubuntu-24.04
70+
strategy:
71+
fail-fast: false
72+
matrix:
73+
python_version:
74+
- "3.9"
75+
- "3.10"
76+
- "3.11"
77+
- "3.12"
78+
- "3.13"
79+
# - "pypy-3.7"
80+
# - "pypy-3.9"
81+
# - "pypy-3.10"
82+
name: Test (${{ matrix.python_version }})
3883
steps:
39-
- uses: actions/checkout@v3
40-
- name: Set up Python 3
41-
uses: actions/setup-python@v3
84+
- uses: actions/checkout@v4
85+
- name: Set up Python ${{ matrix.python_version }}
86+
uses: actions/setup-python@v4
4287
with:
43-
python-version: "3.10"
44-
- name: Install dependencies
88+
python-version: ${{ matrix.python_version }}
89+
- name: Install dev dependencies
4590
run: |
4691
python -m pip install --upgrade pip
47-
pip install responses
48-
pip install coverage
49-
python ${{ github.workspace }}/setup.py install
50-
- name: Run Tests
51-
run: |
52-
python -m coverage run -m unittest
53-
python -m coverage xml
54-
- name: Upload coverage to Codecov
55-
uses: codecov/codecov-action@v3
56-
92+
pip install -r requirements/base.txt -r requirements/dev.txt
93+
- name: "run tests"
94+
run: python -m unittest
95+
5796
publish:
58-
if: startsWith(github.ref, 'refs/tags/v')
59-
needs: test
60-
runs-on: ubuntu-latest
97+
name: Publish
98+
if: >-
99+
((github.event_name == 'workflow_dispatch') || (github.event_name == 'push')) &&
100+
startsWith(github.ref, 'refs/tags/v')
101+
needs: [build, test, lint]
102+
runs-on: "ubuntu-24.04"
61103
steps:
62-
- uses: actions/checkout@v2
104+
- uses: actions/checkout@v3
63105
- name: Download all workflow run artifacts
64-
uses: actions/download-artifact@v2
106+
uses: actions/download-artifact@v4
65107
with:
66108
name: dist
67-
path: dist
109+
path: dist
68110
- name: Set up Python 3
69-
uses: actions/setup-python@v3
111+
uses: actions/setup-python@v4
70112
with:
71-
python-version: "3.10"
72-
- name: Publish packages to PyPi
113+
python-version: "3.13"
114+
- name: Install dev dependencies
115+
run: |
116+
python -m pip install --upgrade pip
117+
pip install -r requirements/base.txt -r requirements/dev.txt
118+
- name: Publish packages to PyPI
119+
# could probably move this into a just recipe too?
73120
run: |
74-
python -m pip install --upgrade twine
75-
set -ex
76-
export VERSION=$(python3 setup.py --version)
77-
python -m twine upload --verbose dist/razorpay-$VERSION-py3-none-any.whl dist/razorpay-$VERSION.tar.gz
121+
export VERSION=$(cat VERSION)
122+
python -m twine upload --verbose dist/razorpay_py-$VERSION.tar.gz dist/razorpay_py-$VERSION-py3-none-any.whl
78123
env:
79124
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
80125
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
81-

.github/workflows/genesis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/python.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ target/
6060

6161
.DS_Store
6262
.idea
63+
64+
.vscode
65+
.venv

0 commit comments

Comments
 (0)