Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote speedup to top level #102

Merged
merged 59 commits into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
f3cc5fb
ignores venv and vs folders
philipmat Aug 15, 2020
d411737
moves all previous files in v1.x
philipmat Aug 16, 2020
0584dbb
updates pep8Enabled to pycodestyleEnabled as the name has changed
philipmat Aug 16, 2020
d7fc850
moves files from speedup one level up
philipmat Aug 16, 2020
9dd5ca7
explicit imports from parsers
philipmat Aug 16, 2020
2e96f1a
forces newline on file open to keep windows csv writer happy
philipmat Aug 16, 2020
ed44de0
leaves out ncol= because it creates problems on narrower terminals
philipmat Aug 16, 2020
8e7274e
renames parser to discogsparser to avoid conflict with python's parse…
philipmat Aug 16, 2020
a6633dd
uses pathlib to add the parent path to the sys.path
philipmat Aug 16, 2020
6224140
since the csv files seem to be written UTF-8, ensure we read them the…
philipmat Aug 16, 2020
ecb005a
moves postgres files one level up
philipmat Aug 16, 2020
8cc6f5d
updates requirements
philipmat Aug 16, 2020
8cc8c9e
moves mysql one level up
philipmat Aug 16, 2020
7f2d1e0
mysql seems to prefer port 3306
philipmat Aug 16, 2020
fcca0a6
updates README file based on speedup
philipmat Aug 16, 2020
54ebdc0
adds words specific to README to cspell dictionary
philipmat Aug 16, 2020
65ad6d9
added badges for master and develop (not sure it works)
philipmat Aug 16, 2020
d73266e
removes 2.x; adds 3.7 and nightly
philipmat Aug 16, 2020
a90d24c
removes speedup folder from readme
philipmat Aug 17, 2020
c8bc2a6
removes speedup folder
philipmat Aug 17, 2020
dc4f348
adds dev requirements
philipmat Aug 17, 2020
bbafc06
sets black line length to 120
philipmat Aug 17, 2020
fb75e3c
temporarily disables black
philipmat Aug 17, 2020
cce0aa4
fixes pep8 warnings for exporter and parser
philipmat Aug 17, 2020
36399bc
updates config files for CI support
philipmat Aug 18, 2020
91d4d80
adds task file to pycodestyle all files
philipmat Aug 18, 2020
8d6c8c6
fixes all pycodestyle issues reported
philipmat Aug 18, 2020
9603fd3
creates module for all discogsxml2db core
philipmat Aug 18, 2020
44af476
updates travis file with new folder
philipmat Aug 18, 2020
906d619
Merge branch 'develop' into merge_speedup
philipmat Aug 18, 2020
7fd0939
switches linter to pycodestyle
philipmat Aug 18, 2020
b4fd603
shorterns pycodestyle task
philipmat Aug 18, 2020
d9f7138
adds a github actions badge
philipmat Aug 18, 2020
70b2b36
minimum version is python 3.6
philipmat Aug 18, 2020
e395b02
adds user agent in support of GH #101
philipmat Aug 18, 2020
087849a
expands some variable names to make them easier to read
philipmat Aug 18, 2020
3c41b86
Merge branch 'develop' into merge_speedup
philipmat Aug 20, 2020
1979a6e
initial frame for sample extraction
philipmat Aug 22, 2020
2092301
extracts records from input file and writes them to an output file
philipmat Aug 22, 2020
527b493
launch file with support for debugging
philipmat Aug 22, 2020
11fd9c7
accounts for some elements having id for attributess
philipmat Aug 22, 2020
25c49f5
tests for id attribute then looks up to find id node
philipmat Aug 23, 2020
ba7e6b2
clears node to keep memory low
philipmat Aug 23, 2020
f4d53b1
file needs to be opened in binary mode
philipmat Aug 23, 2020
2c0242c
lxml requires file to be open in binary mode
philipmat Aug 23, 2020
814454c
adds back reference to a missed function
philipmat Aug 23, 2020
e6efbe2
creates output path if it doesn't exist
philipmat Aug 23, 2020
db22d08
Merge branch 'merge_speedup' into speedup_tests
philipmat Aug 23, 2020
076fb43
identifies top-level element based on child or id attribute
philipmat Aug 23, 2020
21724be
renames counter to parse_count
philipmat Aug 23, 2020
73a7ebe
detects absolute file path before calling parents
philipmat Aug 23, 2020
540f264
wraps in main to avoid being called by pytest
philipmat Aug 23, 2020
f12a9cd
adds 1k samples from each 2020-08 file
philipmat Aug 23, 2020
96fbf9e
tests extraction process against samples
philipmat Aug 23, 2020
2b211db
uses pytest's tmp_path management
philipmat Aug 23, 2020
22f0494
removes v1.x because it interfers with pytest's discovery
philipmat Aug 23, 2020
864b9a2
Runs GitHub Actions on any push or pull request
philipmat Aug 23, 2020
b2a110c
Removes ending comma to satisfy linter
philipmat Aug 23, 2020
5983905
Merge pull request #110 from philipmat/speedup_tests
philipmat Aug 23, 2020
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
19 changes: 10 additions & 9 deletions .github/workflows/python-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

name: Python build check

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
on: [ push, pull_request ]
# push:
# branches: [ develop ]
# pull_request:
# branches: [ develop ]

jobs:
build:
Expand All @@ -26,15 +26,16 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
- name: Lint with pycodestyle
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# pycodestyle . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
pycodestyle . --count --show-source --statistics --exclude=.git,.venv,__pycache__,v1.x
- name: Test with pytest
run: |
pytest
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ Session.vim
discogs_*_*.xml
COUCH
tmp

# JetBrains IDE folder
.idea/

# virtual environment folder
.venv/

# Visual Studio folder
.vs/
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
language: python
python:
- "2.6"
- "2.7"
- "3.6"
- "nightly" # currently points to 3.7-dev
- "3.7"
- "nightly"

before_install:
- pip install pep8
- pip install -r requirements-dev.txt

# command to install dependencies
install:
- pip install -r requirements.txt
- pip install -U pytest

# command to run tests
# TODO: add flake8, pytest
# Powershell:
# pycodestyle.exe @(gci -path .\*.py, .\parsers\*.py, .\mysql\*.py, .\postgresql\*.py | select -ExpandProperty fullname )
script:
- pep8 *.py
- pycodestyle *.py
- pycodestyle discogsxml2db/*.py
- pycodestyle mysql/*.py
- pycodestyle postgresql/*.py
- python -m py_compile *.py
- pytest -v
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"args": [
"${input:discogsFile}"
]
}
],
"inputs": [{
"id": "discogsFile",
"type": "promptString",
"description": "Path to a discogs files (artists, labels, etc)"
}]
}
47 changes: 45 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
// Place your settings in this file to overwrite default and user settings.
{
"python.linting.pep8Enabled": true,
"python.linting.pylintEnabled": false
"python.linting.pycodestyleEnabled": true,
"python.linting.pylintEnabled": false,
"python.linting.prospectorEnabled": false,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length",
"100"
],
"[python]": {
"editor.formatOnSave": false
},
"cSpell.words": [
"ABCDEFG",
"Alexi",
"Cari",
"Lekebusch",
"apicounts",
"catno",
"contactinfo",
"couchimport",
"csvdir",
"discogs",
"fname",
"fobj",
"fpath",
"headerline",
"importcsv",
"iterchildren",
"itertools",
"libpq",
"lxml",
"mongoimport",
"namevariation",
"ncols",
"noqa",
"pbar",
"postgresql",
"psql",
"pycache",
"pycodestyle",
"pytest",
"tqdm",
"venv"
]
}
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "pycodestyle all files",
"type": "shell",
"command": "pycodestyle",
"windows": {
"command": "pycodestyle . --exclude=.git,.venv,__pycache__,v1.x --count --statistics"
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": {
"fileLocation": "absolute",
"pattern":{
"regexp": "^([^\\\\s].*):\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",
"file": 1,
"location": 2,
"message": 3
}
}
}
]
}
Loading