Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions .github/workflows/documentation_check.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
name: Documentation Check

on: [push, pull_request]
on:
push:
branches: [main]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why not leave the check on in branches as well?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Basically, it just cuts down on unnecessary runs. It still runs on PR, but it won't run every single time you push an update. Sometimes when you are in the middle of a PR not everything works, so if you push a commit that doesn't complete the PR you'll get unnecessary warnings.

I mean I don't think it is necessary for every single commit push, do you?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this stop it from running in your own branch before you open a PR? You certainly want a clean run in your branch before opening the PR.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It stops it from running every time you push a commit that isn't part of a PR. It's basically just meant to cut down on test runs/reduce minutes used. I don't think we are ever at risk of using all the minutes up on the free plan, but it helps to be efficient. You can also run into issues if you submit multiple commits within a short amount of time, because caching can get corrupted etc... Less runs is generally better if you can get away with it.

As for having a 'dirty' run when you submit a PR, deadlinks aren't mission-critical, just an annoyance that can easily be fixed.

pull_request:

jobs:
markdown-link-check:
name: Check markdown links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: gaurav-nelson/github-action-markdown-link-check@v1
- name: Checkout Code
uses: actions/checkout@v4

- name: Link Checker
uses: lycheeverse/lychee-action@v2
with:
# Check all markdown files recursively
args: --config lychee.toml --verbose --no-progress './**/*.md'
# Fail the job if broken links are found
fail: true
2 changes: 1 addition & 1 deletion .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
python-version: ["3.10"]
env:
PYTHONPATH: ./src:./tests
MYPYPATH: ./src:./tests:./src/stubs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unix_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: ["3.10", 3.11, 3.12, 3.13, 3.14]
env:
PYTHONPATH: ./src:./test
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
python-version: [3.8, 3.9, "3.10", 3.11, 3.12]
python-version: ["3.10", 3.11, 3.12, 3.13, 3.14]
env:
PYTHONPATH: .\src;.\test
steps:
Expand Down
6 changes: 3 additions & 3 deletions README.dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RP2 is released under the terms of Apache License Version 2.0. For more informat
The latest RP2 source can be downloaded at: <https://github.com/eprbell/rp2>

## Setup
RP2 has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.8.0 or greater. Virtualenv is recommended for RP2 development.
RP2 has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.10.0 or greater. Virtualenv is recommended for RP2 development.

### Setup on Ubuntu Linux
First make sure Python, pip and virtualenv are installed. If not, open a terminal window and enter the following commands:
Expand Down Expand Up @@ -82,7 +82,7 @@ virtualenv -p python3 .venv
.venv/bin/pip3 install -e '.[dev]'
```
### Setup on Windows 10
First make sure [Python](https://python.org) 3.8 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH"), then open a PowerShell window and enter the following commands:
First make sure [Python](https://python.org) 3.10 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH"), then open a PowerShell window and enter the following commands:
```
python -m pip install virtualenv
```
Expand All @@ -97,7 +97,7 @@ python -m pip install -e ".[dev]"

If `activate.ps1` cannot be loaded because running scripts is disabled on the system, run `activate.bat` instead or change the PowerShell execution policy `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser`.
### Setup on Other Unix-like Systems
* install python 3.8 or greater
* install python 3.10 or greater
* install pip3
* install virtualenv

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ RP2 is released under the terms of Apache License Version 2.0. For more informat
The latest version of RP2 can be downloaded at: <https://pypi.org/project/rp2/>

## Installation
RP2 has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.8.0 or greater.
RP2 has been tested on Ubuntu Linux, macOS and Windows 10 but it should work on all systems that have Python version 3.10.0 or greater.

### Installation on Ubuntu Linux
Open a terminal window and enter the following commands:
Expand All @@ -133,13 +133,13 @@ Then install RP2:
pip install rp2
```
### Installation on Windows 10
First make sure [Python](https://python.org) 3.8 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH"), then open a PowerShell window and enter the following:
First make sure [Python](https://python.org) 3.10 or greater is installed (in the Python installer window be sure to click on "Add Python to PATH"), then open a PowerShell window and enter the following:
```
pip install rp2
```

### Installation on Other Unix-like Systems
* install python 3.8 or greater
* install python 3.10 or greater
* install pip3

Then install RP2:
Expand Down
7 changes: 7 additions & 0 deletions lychee.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore these domains because they block CI/CD bots
exclude = [
"https://www.forbes.com/.*",
"https://www.reddit.com/.*",
"https://finance.yahoo.com/.*",
"https://www.cointracker.io/.*"
]
6 changes: 5 additions & 1 deletion mypy.ini
Comment thread
macanudo527 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True
show_none_errors = True
strict_equality = True
strict_optional = True
warn_no_return = True
Expand Down Expand Up @@ -110,3 +109,8 @@ disallow_any_generics = False
disallow_any_decorated = False
disallow_any_explicit = False
disallow_any_expr = False

[mypy-test_input_parser]
disallow_any_expr = False
warn_return_any = False
disallow_any_explicit = False
7 changes: 4 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ classifiers =
Intended Audience :: End Users/Desktop
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14
Topic :: Office/Business :: Financial :: Accounting
Topic :: Utilities
Typing :: Typed
Expand Down Expand Up @@ -56,13 +56,14 @@ dev =
pytest-mock
rope
types-jsonschema
types-pycountry
types-python-dateutil

[options.packages.find]
where = src
include_package_data = True
zip_safe = False
python_requires = >=3.8
python_requires = >=3.10

[options.package_data]
rp2 = py.typed, locales/*/*/*.mo
Expand Down
2 changes: 2 additions & 0 deletions src/rp2/rp2_decimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# pylint: disable=signature-differs

from decimal import Decimal, FloatOperation, getcontext

from rp2.rp2_error import RP2TypeError
Expand Down
12 changes: 6 additions & 6 deletions tests/test_input_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _verify_non_empty_in_table(self, in_transaction_set: TransactionSet, asset:

transaction: Optional[InTransaction] = None
previous_transaction: Optional[InTransaction] = None
for ( # type: ignore
for (
transaction,
internal_id,
timestamp,
Expand All @@ -117,7 +117,7 @@ def _verify_non_empty_in_table(self, in_transaction_set: TransactionSet, asset:
crypto_balance_change,
fiat_balance_change,
is_taxable,
) in zip( # type: ignore
) in zip(
in_transaction_set,
internal_ids,
timestamps,
Expand Down Expand Up @@ -182,7 +182,7 @@ def _verify_non_empty_out_table(self, out_transaction_set: TransactionSet, asset
transaction: Optional[OutTransaction] = None
previous_transaction: Optional[OutTransaction] = None

for ( # type: ignore
for (
transaction,
internal_id,
timestamp,
Expand All @@ -192,7 +192,7 @@ def _verify_non_empty_out_table(self, out_transaction_set: TransactionSet, asset
crypto_balance_change,
fiat_balance_change,
is_taxable,
) in zip( # type: ignore
) in zip(
out_transaction_set,
internal_ids,
timestamps,
Expand Down Expand Up @@ -254,7 +254,7 @@ def _verify_non_empty_intra_table(self, intra_transaction_set: TransactionSet, a

transaction: Optional[IntraTransaction] = None
previous_transaction: Optional[IntraTransaction] = None
for ( # type: ignore
for (
transaction,
internal_id,
timestamp,
Expand All @@ -264,7 +264,7 @@ def _verify_non_empty_intra_table(self, intra_transaction_set: TransactionSet, a
crypto_balance_change,
fiat_balance_change,
is_taxable,
) in zip( # type: ignore
) in zip(
intra_transaction_set,
internal_ids,
timestamps,
Expand Down
Loading