Compare commits

...

8 commits

Author SHA1 Message Date
Jinx
6eaa1b57a2
Merge 72bc34e4af into 61ea1f54d2 2024-12-23 21:26:17 +01:00
dependabot[bot]
61ea1f54d2 Update psycopg2-binary requirement
Some checks are pending
CI / lint (push) Waiting to run
CI / test (mariadb, minimal, 3.11) (push) Blocked by required conditions
CI / test (mariadb, normal, 3.11) (push) Blocked by required conditions
CI / test (mariadb, normal, 3.9) (push) Blocked by required conditions
CI / test (postgresql, minimal, 3.11) (push) Blocked by required conditions
CI / test (postgresql, normal, 3.11) (push) Blocked by required conditions
CI / test (postgresql, normal, 3.9) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.10) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.11) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.12) (push) Blocked by required conditions
CI / test (sqlite, minimal, 3.9) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.10) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.11) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.12) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.8) (push) Blocked by required conditions
CI / test (sqlite, normal, 3.9) (push) Blocked by required conditions
CI / docs (push) Waiting to run
Docker build / test (push) Waiting to run
Docker build / build_upload (push) Blocked by required conditions
Updates the requirements on [psycopg2-binary](https://github.com/psycopg/psycopg2) to permit the latest version.
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/compare/2.9.6...2.9.10)

---
updated-dependencies:
- dependency-name: psycopg2-binary
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:26:07 +01:00
dependabot[bot]
299c384908 Bump ruff from 0.6.8 to 0.8.4
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.6.8 to 0.8.4.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](https://github.com/astral-sh/ruff/compare/0.6.8...0.8.4)

---
updated-dependencies:
- dependency-name: ruff
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:24:04 +01:00
dependabot[bot]
4e9ff9b1ac Update qrcode requirement from <8,>=7.1 to >=7.1,<9
Updates the requirements on [qrcode](https://github.com/lincolnloop/python-qrcode) to permit the latest version.
- [Changelog](https://github.com/lincolnloop/python-qrcode/blob/main/CHANGES.rst)
- [Commits](https://github.com/lincolnloop/python-qrcode/compare/v7.1...v8.0)

---
updated-dependencies:
- dependency-name: qrcode
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:23:54 +01:00
dependabot[bot]
2aa410c68f Update cachetools requirement from <5,>=4.1 to >=4.1,<6
Updates the requirements on [cachetools](https://github.com/tkem/cachetools) to permit the latest version.
- [Changelog](https://github.com/tkem/cachetools/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/tkem/cachetools/compare/v4.1.0...v5.5.0)

---
updated-dependencies:
- dependency-name: cachetools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 21:23:33 +01:00
Jinx
72bc34e4af Fixed the way the #1288 csv file test is loaded 2024-02-19 16:25:30 +08:00
Jinx
f9e1e9241c
Merge branch 'spiral-project:master' into master 2024-02-19 16:00:47 +08:00
Jinx
12c77b4850 Fixing the issue of garbled characters (Chinese characters) when opening the CSV export in Microsoft Excel. 2024-02-04 14:20:10 +08:00
3 changed files with 9 additions and 9 deletions

View file

@ -442,7 +442,7 @@ class TestExport(IhatemoneyTestCase):
'2016-12-31,red wine,Expense,XXX,200.0,jeanne,1.0,"zorglub, tata"', '2016-12-31,red wine,Expense,XXX,200.0,jeanne,1.0,"zorglub, tata"',
'2016-12-31,à raclette,Expense,10.0,XXX,zorglub,2.0,"zorglub, jeanne, tata, pépé"', '2016-12-31,à raclette,Expense,10.0,XXX,zorglub,2.0,"zorglub, jeanne, tata, pépé"',
] ]
received_lines = resp.data.decode("utf-8").split("\n") received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected): for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(",")) assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))
@ -476,7 +476,7 @@ class TestExport(IhatemoneyTestCase):
"55.34,XXX,jeanne,tata", "55.34,XXX,jeanne,tata",
"127.33,XXX,jeanne,zorglub", "127.33,XXX,jeanne,zorglub",
] ]
received_lines = resp.data.decode("utf-8").split("\n") received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected): for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(",")) assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))
@ -682,7 +682,7 @@ class TestExport(IhatemoneyTestCase):
"date,what,bill_type,amount,currency,payer_name,payer_weight,owers", "date,what,bill_type,amount,currency,payer_name,payer_weight,owers",
"2016-12-31,'=COS(36),Expense,10.0,EUR,zorglub,1.0,zorglub", "2016-12-31,'=COS(36),Expense,10.0,EUR,zorglub,1.0,zorglub",
] ]
received_lines = resp.data.decode("utf-8").split("\n") received_lines = resp.data.decode("utf-8-sig").split("\n")
for i, line in enumerate(expected): for i, line in enumerate(expected):
assert set(line.split(",")) == set(received_lines[i].strip("\r").split(",")) assert set(line.split(",")) == set(received_lines[i].strip("\r").split(","))

View file

@ -194,7 +194,7 @@ def list_of_dicts2csv(dict_to_convert):
writer = csv.writer(csv_file) writer = csv.writer(csv_file)
writer.writerows(csv_data) writer.writerows(csv_data)
csv_file.seek(0) csv_file.seek(0)
csv_file = BytesIO(csv_file.getvalue().encode("utf-8")) csv_file = BytesIO(csv_file.getvalue().encode("utf-8-sig"))
return csv_file return csv_file
@ -202,7 +202,7 @@ def csv2list_of_dicts(csv_to_convert):
"""Take a csv in-memory file and turns it into """Take a csv in-memory file and turns it into
a list of dictionnaries a list of dictionnaries
""" """
csv_file = TextIOWrapper(csv_to_convert, encoding="utf-8") csv_file = TextIOWrapper(csv_to_convert, encoding="utf-8-sig")
reader = csv.DictReader(csv_file) reader = csv.DictReader(csv_file)
result = [] result = []
for r in reader: for r in reader:

View file

@ -27,7 +27,7 @@ classifiers = [
dependencies = [ dependencies = [
"blinker>=1.4,<2", "blinker>=1.4,<2",
"cachetools>=4.1,<5", "cachetools>=4.1,<6",
"debts>=0.5,<1", "debts>=0.5,<1",
"email_validator>=1.0,<3", "email_validator>=1.0,<3",
"Flask>=2,<4", "Flask>=2,<4",
@ -43,7 +43,7 @@ dependencies = [
"itsdangerous>=2,<3", "itsdangerous>=2,<3",
"Jinja2>=3,<4", "Jinja2>=3,<4",
"python-dateutil", "python-dateutil",
"qrcode>=7.1,<8", "qrcode>=7.1,<9",
"requests>=2.25,<3", "requests>=2.25,<3",
"SQLAlchemy>=1.3.0,<1.5", "SQLAlchemy>=1.3.0,<1.5",
"SQLAlchemy-Continuum>=1.3.12,<2", # New 1.4 changes API, see #728 "SQLAlchemy-Continuum>=1.3.12,<2", # New 1.4 changes API, see #728
@ -53,11 +53,11 @@ dependencies = [
[project.optional-dependencies] [project.optional-dependencies]
database = [ database = [
# Python 3.11 support starts in 2.9.2 # Python 3.11 support starts in 2.9.2
"psycopg2-binary>=2.9.2,<2.9.9", "psycopg2-binary>=2.9.2,<2.9.11",
"PyMySQL>=0.9,<1.2", "PyMySQL>=0.9,<1.2",
] ]
dev = [ dev = [
"ruff==0.6.8", "ruff==0.8.4",
"flake8==5.0.4", "flake8==5.0.4",
"isort==5.11.5", "isort==5.11.5",
"vermin==1.6.0", "vermin==1.6.0",