Skip to content

Commit d2542ed

Browse files
authored
Merge pull request #171 from philipmat/philipmat-patch-1
Updates build/test matrix versions to what's available on GH actions
2 parents a617de8 + 4c21eda commit d2542ed

3 files changed

Lines changed: 20 additions & 35 deletions

File tree

.github/workflows/python-build-check.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,18 @@ on:
1717
jobs:
1818
build:
1919

20-
runs-on: ubuntu-20.04
20+
runs-on: ubuntu-latest
2121
strategy:
2222
matrix:
23-
python-version: [3.7, 3.8, 3.12]
23+
python-version:
24+
- '3.10' # earliest to still receive security updates (rel 2021-10-04, EOL 2023-04-05, Sec EOL 2026-10-31)
25+
- '3.13' # current dev (rel 2024-10-07, EOL 2026-10-31, Sec EOL 2029-10-31)
26+
- '3.x' # most recent python available, based on https://endoflife.date/python
2427

2528
steps:
26-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@v6
2730
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v5
31+
uses: actions/setup-python@v6
2932
with:
3033
python-version: ${{ matrix.python-version }}
3134
- name: Install dependencies

README.md

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33
discogs-xml2db is a python program for importing [discogs data dumps](https://data.discogs.com/)
44
into several databases.
55

6-
Version 2 is a rewrite of the original *discogs-xml2db*
7-
(referred to here as the *classic* version).
8-
It is based on a [branch by RedApple,](https://github.com/redapple/discogs-xml2db)
9-
and it is several times faster.
6+
It exports to CSV as an intermediate step.
7+
It can then import these CSV files into MySQL, PostgreSQL, and SQLite
8+
through provided scripts/instructions.
9+
10+
Instructions for importing into MongoDB, though these are untested.
1011

11-
Currently, it supports MySQL and PostgreSQL as target databases.
12-
Instructions for importing into MongoDB, though these are untested.
1312
Let us know how it goes!
1413

1514
## Experimental version
@@ -42,8 +41,12 @@ eventually replace it.
4241

4342
### Requirements
4443

45-
**discogs-xml2db requires python3 (minimum 3.6)** and some python modules.
46-
Additionally, the bash shell is used for automating some tasks.
44+
**discogs-xml2db requires python3** and some python modules.
45+
Additionally, the bash shell is used for automating some tasks.
46+
47+
**Note**: the minimum version _tested_ is the one that still receives
48+
security updates according to <https://endoflife.date/python>. It
49+
might work with earlier versions, but no guarantees.
4750

4851
Importing to some databases may require additional dependencies,
4952
see the documentation for your target database below.
@@ -221,7 +224,7 @@ $ nano postgresql/postgresql.conf
221224

222225
# Configure primary keys and constraints, build indexes
223226
(.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreatePrimaryKeys.sql
224-
(.discogsenv) $python3 postgresql/psql.py < postgresql/sql/CreateFKConstraints.sql
227+
(.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreateFKConstraints.sql
225228
(.discogsenv) $ python3 postgresql/psql.py < postgresql/sql/CreateIndexes.sql
226229
```
227230

@@ -263,28 +266,6 @@ The CSV files can be imported into MongoDB using
263266
mongoimport --db=discogs --collection=releases --type=csv --headerline --file=release.csv
264267
```
265268

266-
#### Importing into CouchDB
267-
268-
CouchDB only supports importing JSON files.
269-
[`couchimport`](https://github.com/glynnbird/couchimport) can be used to convert
270-
the CSV files to JSON and import them into CouchDB,
271-
as explained in [this tutorial](https://medium.com/codait/simple-csv-import-for-couchdb-71616200b095).
272-
273-
## Comparison to classic discogs-xml2db
274-
275-
*speedup* is many times faster than *classic* because it uses a different approach:
276-
277-
1. The discogs XML dumps are first converted into one csv file per database table.
278-
2. These csv files are then imported into the different target databases (bulk load).
279-
This is different from *classic* discogs-xml2db, which loads records into the database
280-
one by one while parsing the XML file, waiting on the database after every row.
281-
282-
*speedup* requires less disk space than *classic* as it can work while the dump files are still compressed.
283-
While the uncompressed dumps for May 2020 take up 57GB of space, the compressed dumps are only 8.8GB.
284-
The dumps can be deleted after converting them to compressed CSV files (6.1GB).
285-
286-
As many databases can import CSV files out of the box, it should be easy
287-
to add support for more databases to discogs-xml2db *speedup* in the future.
288269

289270
### Database schema changes
290271

tests/fixtures/generate_fixtures.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def finish(self) -> None:
7272
file=sys.stderr,
7373
)
7474

75+
7576
def make_progress(label: str, every: int) -> Optional[Progress]:
7677
"""Create a Progress helper or return None when disabled."""
7778
if every <= 0:

0 commit comments

Comments
 (0)