Skip to content

Commit 480a948

Browse files
committed
Post TR2 Attempt 2
2 parents 51fb932 + df2997f commit 480a948

7 files changed

Lines changed: 25 additions & 33 deletions

File tree

tinydb/README.md

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

tinydb/create_db.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@
2222
for row in reader:
2323
row["population"] = int(row["population"])
2424
countries_table.insert(row)
25-

tinydb/pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[tool.black]
2+
line-length = 70
3+
target-version = ["py312"]
4+
exclude = '''
5+
/(
6+
\.git
7+
| venv
8+
| migrations
9+
| node_modules
10+
)/
11+
'''
12+
13+
14+
[tool.ruff]
15+
target-version = "py312"
16+
exclude = [".git", "venv", "migrations", "node_modules"]
17+
line-length = 70
18+
19+
[tool.ruff.lint]
20+
select = ["E", "F", "I", "RUF100"]
21+
ignore = ["E501"] # Line length is handled by Black

tinydb/read.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@
1414
pprint(countries_table.search(query_def))
1515
pprint(countries_table.search(query["% of world"] >= 17))
1616
pprint(countries_table.get(doc_ids=[9, 10]))
17-
countries_db.close()
17+
countries_db.close()

tinydb/update_db.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
# from tinydb import TinyDB, where
1818
# with TinyDB("ten_countries.json") as countries_db:
1919
# countries_table = countries_db.table(name="countries")
20-
# pprint(countries_table.search(where("location") == "Mexico"))
20+
# pprint(countries_table.search(where("location") == "Mexico"))

tinydb/update_db_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
where("location") == "Mexico",
1414
),
1515
]
16-
)
16+
)

tinydb/update_db_v3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
with TinyDB("ten_countries.json") as countries_db:
44
countries_table = countries_db.table(name="countries")
5-
countries_table.update({"source": "Official estimate"}, doc_ids=[7, 9])
5+
countries_table.update({"source": "Official estimate"}, doc_ids=[7, 9])

0 commit comments

Comments
 (0)