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

[GH-395] Port to Python 3 #409

Draft
wants to merge 363 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
363 commits
Select commit Hold shift + click to select a range
e138889
Add basic usage of argparse
randomnetcat Dec 21, 2022
e6d1b9f
Add argument for path to 7z
randomnetcat Dec 21, 2022
fc1ea97
Add ability to pass arguments through to dumpgenerator
randomnetcat Dec 21, 2022
4ee63a4
Simplify setting 7z path
randomnetcat Dec 21, 2022
fef85ac
Add launcher docs to README
randomnetcat Dec 21, 2022
29e669b
Add self to README as contributor
randomnetcat Dec 21, 2022
798f6e1
Merge pull request #43 from randomnetcat/launcher
robkam Dec 22, 2022
313169b
Remove xml part of launcher wikidump name
randomnetcat Dec 24, 2022
acd2b82
Merge pull request #44 from randomnetcat/fix-launcher-path
robkam Dec 24, 2022
570ea8f
Force str(xml)
yzqzss Dec 25, 2022
f92872a
print imageName when getImagesAPI() is running
yzqzss Dec 25, 2022
61a56b5
Merge pull request #1 from yzqzss/fix-bytes-regex-2
yzqzss Dec 27, 2022
9717c56
.gitignore add dist/
yzqzss Dec 27, 2022
5fe9b8d
delete dist/
yzqzss Dec 27, 2022
0fc2e21
retry after getting HTTP 429
yzqzss Dec 28, 2022
21e23a7
Update Dependencies
yzqzss Dec 28, 2022
4307fb8
fix bin-style XML
yzqzss Dec 28, 2022
f085af5
reduce dumped XML filesize for --curonly
yzqzss Dec 28, 2022
06da261
completely fix xml en/decode bug
yzqzss Dec 28, 2022
71fc2b6
[Docs] Update checking dump integrity command
yzqzss Dec 29, 2022
0be37c1
build
yzqzss Dec 29, 2022
4d00783
Fix xml de/encode and other improve (#2)
yzqzss Dec 29, 2022
6e71e31
avoid return byte-str
yzqzss Dec 29, 2022
f3d22cc
build
yzqzss Dec 29, 2022
e57d18d
Merge branch 'test' into fix-xml-bug
yzqzss Dec 29, 2022
1a0047e
Merge pull request #46 from saveweb/fix-xml-bug
robkam Dec 29, 2022
b29e310
Update greeter.py
robkam Dec 30, 2022
5876842
.gitignore: ignore tests/tmp
yzqzss Dec 30, 2022
f65e10e
fix incomplete imageNames grab (API:Allpage)
yzqzss Dec 30, 2022
da0df22
Merge pull request #48 from saveweb/fix-imageNames-grab
robkam Dec 30, 2022
9b4f21d
Add dump date to item identifier
yzqzss Jan 2, 2023
0bb5c52
import "domain2prefix" and "getUserAgent"
yzqzss Jan 2, 2023
c0c8f5d
Display appended-date IA URL if appended
yzqzss Jan 2, 2023
f32a5f0
Update mediawiki wikifarm lists
yzqzss Jan 2, 2023
40ce314
rm xml.py
yzqzss Jan 2, 2023
5643b65
style: launcher.py
yzqzss Jan 2, 2023
a4526f8
add __main__.py
yzqzss Jan 3, 2023
bb9388d
rm useless str()
yzqzss Jan 3, 2023
ce7f404
typo.
yzqzss Jan 3, 2023
6a99870
rm useless str()
yzqzss Jan 3, 2023
fa5e3cc
truncate the XML to a <page> with a <title>
yzqzss Jan 3, 2023
b736ec5
typo
yzqzss Jan 3, 2023
1bbba09
revert miraheze.org.info
yzqzss Jan 3, 2023
97639e1
Use `session.get` instead of `requests.get` in `getXMLHeader`
yzqzss Jan 4, 2023
126d28e
Add uploader in pyproject
randomnetcat Dec 24, 2022
887b309
Fix dumpgenerator import
randomnetcat Dec 24, 2022
8733def
Add imports for dumpgenerator functions
randomnetcat Dec 24, 2022
4197ffa
Fix use of has_key
randomnetcat Dec 24, 2022
4bbb414
Remove useless configtemp
randomnetcat Dec 30, 2022
3ab2c33
Add command line argument for keyfile location
randomnetcat Dec 30, 2022
019a987
Compute file hashes in python
randomnetcat Dec 31, 2022
a39fc4e
Migrate uploader to using pathlib
randomnetcat Jan 4, 2023
542f221
Add command line argument for log file
randomnetcat Jan 4, 2023
0a154c0
rm more useless str() and add some type hints
yzqzss Jan 4, 2023
6678156
print "X title, y edits" instead of "X more revisions exported"
yzqzss Jan 4, 2023
7021e12
Update argument short forms
randomnetcat Jan 5, 2023
4021508
Add information to README
randomnetcat Jan 5, 2023
db075d9
Add -wd to README
randomnetcat Jan 5, 2023
0424941
reuse requests.session for getWikiEngine() and mwGetAPIAndIndex()
yzqzss Jan 5, 2023
d254d90
move `#Execute meta info params` code block
yzqzss Jan 5, 2023
d17c680
refactor: xml_dump.py
yzqzss Jan 5, 2023
4079a51
Merge pull request #50 from randomnetcat/uploader
robkam Jan 5, 2023
3e84d9c
Update .gitignore
robkam Jan 5, 2023
038def2
Merge branch 'python3' into test
yzqzss Jan 5, 2023
cc91fb2
Merge pull request #49 from saveweb/test
robkam Jan 5, 2023
387eff1
Merge branch 'python3' into robkam-patch-3
robkam Jan 5, 2023
3498189
Merge branch 'python3' into robkam-tweak-readme
robkam Jan 5, 2023
e4b9f1b
Merge branch 'python3' into robkam-patch-1
robkam Jan 5, 2023
a32d61c
update regex to match `'` and `"` in `<option>` tag
yzqzss Jan 5, 2023
980810b
update dependencies
yzqzss Jan 5, 2023
b03b61f
build
yzqzss Jan 5, 2023
ea4070f
Merge pull request #54 from saveweb/test
robkam Jan 5, 2023
d47a51b
Merge pull request #47 from elsiehupp/robkam-patch-1
robkam Jan 5, 2023
dfa2f6b
Add very basic option to copy stdout to file
randomnetcat Jan 5, 2023
16add97
Merge pull request #56 from randomnetcat/log-file
robkam Jan 5, 2023
c5e3f09
Merge branch 'python3' into robkam-patch-3
robkam Jan 6, 2023
0a9a81d
Merge branch 'python3' into robkam-tweak-readme
robkam Jan 6, 2023
01a9e55
Replace invalid space attribute with xml:space attribute in text element
yzqzss Jan 7, 2023
948bdd4
Remove empty comment element if no comment provided
yzqzss Jan 7, 2023
d1c2fe1
rename log argument with `stdout` prefix to avoid confusion (#56)
yzqzss Jan 8, 2023
9851829
Merge pull request #57 from saveweb/rename-log-argument
robkam Jan 8, 2023
4f3e2bf
Merge branch 'python3' into robkam-patch-3
elsiehupp Jan 12, 2023
939f695
Merge pull request #52 from elsiehupp/robkam-patch-3
elsiehupp Jan 12, 2023
7275fd7
Merge branch 'python3' into robkam-tweak-readme
elsiehupp Jan 12, 2023
f8e5ae9
Merge pull request #36 from elsiehupp/robkam-tweak-readme
elsiehupp Jan 12, 2023
1332a2e
Export path to PYTHONPATH when starting python subprocesses
randomnetcat Jan 12, 2023
0225583
Merge pull request #62 from randomnetcat/generator-path
robkam Jan 12, 2023
b8ee71c
Update generator.py
robkam Jan 12, 2023
cdfa5ef
Merge pull request #63 from elsiehupp/robkam-patch-1
randomnetcat Jan 12, 2023
d8f595e
Pass requests session to mwclient
yzqzss Jan 8, 2023
aed4cdd
update UA
yzqzss Jan 10, 2023
331c497
make requests.session to use `--retries` value
yzqzss Jan 10, 2023
0bc8161
Remove duplicate code block for downloading images
yzqzss Jan 8, 2023
6327064
Add to_stdout parameter to logerror() for printing errors to stdout
yzqzss Jan 8, 2023
22c8955
print error msg
yzqzss Jan 10, 2023
375e6ae
remove redundant retry logic
yzqzss Jan 10, 2023
fa246d2
fix: index url computation fails on some wikis
yzqzss Jan 10, 2023
95dd2e8
Merge pull request #66 from saveweb/requests-session
robkam Jan 13, 2023
0bb5e1e
Merge pull request #69 from saveweb/redundant-retry
robkam Jan 13, 2023
aade746
Merge pull request #67 from saveweb/logerror-to-stdout
robkam Jan 13, 2023
d3b1006
Merge pull request #68 from saveweb/remove-dup-code
robkam Jan 13, 2023
eff3a0d
Merge pull request #70 from saveweb/index-computation
robkam Jan 13, 2023
bb03e04
Create ChangeLog (#72)
robkam Jan 13, 2023
121d2ef
Move non-package files to outside folder (resources or tools) & Remov…
NyaMisty Jan 13, 2023
a33a5cd
Refactor dumpgenerator into sub-packages
NyaMisty Jan 13, 2023
17f2446
Merge pull request #74 from saveweb/refactor
robkam Jan 14, 2023
de35c6f
quote title
yzqzss Jan 14, 2023
ac107b2
Merge pull request #78 from saveweb/fix-75
robkam Jan 14, 2023
43791ea
build: fix poetry package including
NyaMisty Jan 14, 2023
19f4ae1
Merge pull request #80 from saveweb/refactor
robkam Jan 14, 2023
0da9861
Update image.py (#81)
robkam Jan 14, 2023
2154ead
refactor: convert config from dict to Config object for better type h…
NyaMisty Jan 13, 2023
62ace72
lint: annotated dumpgenerator.api
NyaMisty Jan 13, 2023
a405c03
lint: added hints for wikiteam3.utils
NyaMisty Jan 13, 2023
b04e684
lint: added type hinting for dump & cli package
NyaMisty Jan 13, 2023
231dbcf
lint: fix all linting warnings
NyaMisty Jan 13, 2023
9981ea3
Merge pull request #83 from saveweb/config_refactor
robkam Jan 14, 2023
bd6fb48
Enhance the stability of the image dump and make it resumable (#88)
yzqzss Jan 15, 2023
f57f50f
tests: add first unit test case with pytest (#91)
NyaMisty Jan 15, 2023
163fd96
Fix: `Delay()` stuck when `Ctrl+C` pressed (#92)
yzqzss Jan 15, 2023
eb479cf
`Special:Version.html` to `SpecialVersion.html` (#64)
robkam Jan 15, 2023
a25be5e
Properly synchronize Delay (#94)
randomnetcat Jan 15, 2023
e40bf72
Fix: unable to get XML via `Special:Export` (--xml) (#96)
yzqzss Jan 15, 2023
c0b55e4
Remove special characte from special_version.py (#97)
randomnetcat Jan 15, 2023
5810f91
Update uses of and/or to proper ternary expressions (#98)
randomnetcat Jan 15, 2023
0fb53ff
Fix line endings (#102)
randomnetcat Jan 15, 2023
be983b0
Refactor xml dump related codes and improve xmlrevision logic (#103)
NyaMisty Jan 16, 2023
7bf5628
Deprecate `truncateFilename()` and increase filename length limit. (#…
yzqzss Jan 16, 2023
05bb04a
Fix some bugs in #103 (#108)
yzqzss Jan 16, 2023
bee0a1b
network: more resillent and responsive to restrive websites (#110)
NyaMisty Jan 17, 2023
3ee3185
Improve image dump logic (#112)
yzqzss Jan 18, 2023
0ad5475
Catch `textmissing` in revision (#111)
yzqzss Jan 18, 2023
dd619eb
Handle missing files with `sha1 == False`. (#114)
yzqzss Jan 18, 2023
8d4164e
Speed up file scanning (#116)
yzqzss Jan 19, 2023
b7b5f9b
Update README.md (#117)
robkam Jan 23, 2023
d989663
Fix: `--xmlrevisions` and `--xmlrevisions_page` can't get any wikitex…
yzqzss Jan 27, 2023
70f52c9
Bump oauthlib from 3.2.0 to 3.2.2 (#122)
dependabot[bot] Feb 10, 2023
71aae07
Update README.md (#120)
robkam Feb 13, 2023
9e647fd
Update README.md (#125)
robkam Feb 13, 2023
3e11e95
Delete ChangeLog (#126)
robkam Feb 13, 2023
710903f
Update README.md (#127)
robkam Feb 14, 2023
a5dcdb9
xmlexport: support export page using pure API (using --xml --xmlapiex…
NyaMisty Jan 19, 2023
20691b5
xmlrev: do not retrive namespace one by one
NyaMisty Jan 22, 2023
48670ab
monkey patch `requests.Response.text` to remove BOM header
yzqzss Jan 26, 2023
5837e12
deprecate: `fixBOM()`
yzqzss Jan 26, 2023
002fbdb
fix: #107
yzqzss Jan 26, 2023
16f708e
handle sha1 missing in image metadata
yzqzss Jan 26, 2023
00c5326
docs: cli help
yzqzss Feb 14, 2023
638c4df
fix: #121
yzqzss Feb 14, 2023
74ead81
feat: Support various login methods.
yzqzss Feb 15, 2023
a0aa9b3
fix: indexLogin is not called
yzqzss Feb 15, 2023
2ff6192
not use `--user` and `--pass` for HTTPBasicAuth
yzqzss Feb 20, 2023
5f2df7e
add `--insecure` option to disable verify
yzqzss Feb 20, 2023
de817f0
move parameter check to `checkParameters()`
yzqzss Feb 20, 2023
ef0ac3c
Create test-dumogenerator.yml
yzqzss Feb 18, 2023
df25bd4
fix: type hints error under py3.9
yzqzss Feb 18, 2023
152ab28
fix: access_key and secret_key are not defined
yzqzss Feb 18, 2023
06da29f
try to resolve all errors reported by flake8
yzqzss Feb 18, 2023
b81e358
enable flake8 basic check
yzqzss Feb 18, 2023
813fb00
Add dump date append to item identifier option
simonliu99 Mar 14, 2023
14acfd1
domain2prefix: rstrip("/")
yzqzss Mar 15, 2023
e03ed88
uploader.py: ref to MediaWiki-Scraper
yzqzss Mar 15, 2023
fe0b726
fix: crash when images.txt is empty
yzqzss Mar 15, 2023
35fbe17
images: handle `user` or `sha1` or `size` missing
yzqzss Mar 15, 2023
2a57072
apply Delay() to mwclient.Site.allpages()
yzqzss Mar 23, 2023
dc27532
dependency: update internetarchive
yzqzss Mar 25, 2023
934161b
exclude dist/ dir from repo
yzqzss Mar 25, 2023
3fea83e
fix: --append_date uploads to multiple IA items
yzqzss Apr 17, 2023
c23fc22
waiting for item to be created before modifying metadata
yzqzss Apr 17, 2023
00b4764
fix: modify_metadata() not work
yzqzss Apr 30, 2023
c03ebad
fix: `--xmlapiexport` fails to get `rvcontinue`
yzqzss May 7, 2023
f01b860
fix: `lxml.etree._Element`: FutureWarning.
yzqzss May 8, 2023
621b052
getXMLPageWithAPI(): pass `contentmodel` to rvprop for future purposes
yzqzss May 8, 2023
d95a1eb
fix exporting via --xmlreisions_page
yzqzss May 8, 2023
68d2752
doc: `API:Allpages` requires MW >= 1.8, not 1.18
yzqzss May 9, 2023
3d0520a
tool: Extracts all titles from a XML dump
yzqzss May 19, 2023
e3295a7
fix: cannot retrieve all titles using the --index method
yzqzss May 22, 2023
1d190b4
build(deps): bump requests from 2.27.1 to 2.31.0
dependabot[bot] May 23, 2023
ab59f18
fix: --xmlrevisions[_page]: `<minor>` tag misssing
yzqzss May 29, 2023
428795b
fix: --xmlapiexport: ValueError caused by a typo
yzqzss May 29, 2023
0b42643
--xmlapiexport: xml: add <parentid>
yzqzss May 29, 2023
74be6e6
--xmlapiexport: xml: better handling of <comment>
yzqzss May 29, 2023
c19e8d6
--xmlapiexport: xml: add <minor>
yzqzss May 29, 2023
551ccaa
--xmlapiexport: xml: not hard-code <model> and <format>
yzqzss May 29, 2023
06acf5e
--xmlapiexport: xml: better handling of <sha1>
yzqzss May 29, 2023
22a692d
Update README.md
robkam Jun 8, 2023
eb1529a
Merge pull request #153 from mediawiki-client-tools/robkam-patch-1
elsiehupp Jun 9, 2023
0b8eff6
refactor: reseparate logic and regex data
yzqzss Jul 1, 2023
f7f24c5
fix: regex[4] not works
yzqzss Jul 1, 2023
a46bd59
fix: ValueError: invalid literal for int()
yzqzss Jul 1, 2023
6a6e700
rename & move `R_NEXT` into html_regexs.py
yzqzss Jul 1, 2023
d5a0a03
test: add tests for html_regexs.py
yzqzss Jul 1, 2023
7d60226
test: add test data for html_regexs.py
yzqzss Jul 1, 2023
5791c56
build: exclude test dir from build
yzqzss Jul 1, 2023
283611d
fix: infinite loop on page title scraper
yzqzss Jul 2, 2023
fbe2a79
Relock dependencies
randomnetcat Jul 3, 2023
98cd2d9
Update README.md (#159)
robkam Jul 6, 2023
4872b5a
Update issue templates
elsiehupp Jul 10, 2023
3525864
Added link to Discussions
elsiehupp Jul 10, 2023
bc895a3
Split Q&A link
elsiehupp Jul 10, 2023
95d8413
Update greeter.py (#160)
robkam Jul 20, 2023
96cc7ca
feat: cli: `--bypass-cdn-image-compression`
yzqzss Jul 20, 2023
e877867
Update README.md
robkam Jul 20, 2023
4e3579f
Update README.md
robkam Jul 20, 2023
dea1ae5
Update bug_report.md
robkam Jul 20, 2023
17d6a39
Update bug_report.md
robkam Jul 20, 2023
4263f3f
Update bug_report.md
robkam Jul 20, 2023
255b052
Update README.md
robkam Jul 21, 2023
659d6d9
Update bug_report.md
elsiehupp Jul 22, 2023
e01895b
Update README.md
elsiehupp Jul 22, 2023
fa08626
build(deps): bump certifi from 2023.5.7 to 2023.7.22
dependabot[bot] Jul 25, 2023
c148708
Merge pull request #164 from mediawiki-client-tools/dependabot/pip/ce…
elsiehupp Aug 1, 2023
4d19dff
build(deps): bump requests from 2.27.1 to 2.31.0
dependabot[bot] Aug 1, 2023
6e4362a
Merge pull request #165 from mediawiki-client-tools/dependabot/pip/re…
elsiehupp Aug 1, 2023
eeab93a
Fix and Run Pre-Commit
elsiehupp Aug 21, 2023
9c65c5a
Merge pull request #171 from mediawiki-client-tools/fix-pre-commit
elsiehupp Aug 21, 2023
530ca45
Update README.md (#168)
robkam Aug 21, 2023
87653ef
Update and rename test-dumogenerator.yml to test-dumpgenerator.yml (#…
robkam Aug 21, 2023
b3a24bb
Update README.md (#174)
robkam Aug 21, 2023
bea45ec
Add CONTRIBUTING Guide (#177)
elsiehupp Aug 29, 2023
80ae8b6
Code of conduct (#178)
elsiehupp Aug 29, 2023
6d044c0
Update README.md (#175)
robkam Aug 29, 2023
69cb2eb
Sourcery refactored python3 branch (#179)
sourcery-ai[bot] Aug 29, 2023
b48a138
Remove unused upstream files (#180)
elsiehupp Aug 29, 2023
490af55
Change name from `mediawiki-scraper` to `mediawiki-dump-generator` (#…
elsiehupp Aug 29, 2023
20a1c7a
Placate mypy (redux) (#186)
elsiehupp Aug 31, 2023
6e5e013
Revert "Placate mypy (redux)" (#188)
elsiehupp Aug 31, 2023
3a50bb7
Update uploader.py (#192)
robkam Sep 1, 2023
625481b
Update gui.py (#193)
robkam Sep 8, 2023
38cf49d
Update README.md (#182)
robkam Sep 8, 2023
5d3b65f
Fix typos (#199)
Glandos Sep 18, 2023
9725f34
Add link to restoring a wiki (#202)
robkam Oct 2, 2023
a7c3138
build(deps): bump urllib3 from 1.26.16 to 1.26.17 (#203)
dependabot[bot] Oct 6, 2023
637df7f
build(deps): bump urllib3 from 1.26.17 to 1.26.18 (#206)
dependabot[bot] Oct 18, 2023
db2edb0
Reorganise the documentation. (#204)
robkam Oct 19, 2023
65e9d84
Support wikis that have an incorrectly configured DH key (#224)
gausie Nov 18, 2023
4889a79
.md link to caps (#225)
eseiver Dec 8, 2023
265855d
Update and remove URLs in test (#227)
sian1468 Dec 18, 2023
eb6e38e
[Backport] Add option to disable image file size check (close #170) (…
sian1468 Dec 18, 2023
e19ffbc
Fix error in commit 265855d (#229)
sian1468 Dec 18, 2023
19ecdfa
Change user_agent.py to use only one user-agent (#233)
sian1468 Jan 21, 2024
521b081
Update INSTALLATION.md (#222)
drjwbaker Mar 27, 2024
a8d2ef0
fix #211 (#220)
robkam Mar 28, 2024
6cf2fab
build(deps): bump idna from 3.4 to 3.7 (#235)
dependabot[bot] May 21, 2024
a843168
build(deps): bump tqdm from 4.66.1 to 4.66.3 (#236)
dependabot[bot] May 21, 2024
5a37ec9
build(deps): bump requests from 2.31.0 to 2.32.0 (#241)
dependabot[bot] May 21, 2024
3f7bfd7
build(deps): bump pymysql from 1.1.0 to 1.1.1 (#242)
dependabot[bot] May 21, 2024
ba9d181
Update dependencies (#253)
randomnetcat Sep 23, 2024
701c6e4
Fix failing test, and other cleanups (#245)
robkam Sep 23, 2024
fb18862
Update image regex to handle new page format (#254)
randomnetcat Sep 23, 2024
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
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
*.com linguist-vendored
*.org linguist-vendored

*.py text=auto
*.sh text=auto
*.json text=auto
*.txt text=auto
*.md text=auto
85 changes: 85 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
name: Bug Report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

<!-- Thank you for helping to improve MediaWiki Dump Generator! -->

<!-- So that we can better address your issue,
please fill out as much of the following as possible. -->

## Describe the Bug

<!-- A brief but clear summary -->

### Expected Behavior

<!-- What did you expect to happen? -->

### Actual Behavior

<!-- What happened instead? -->

## Command for Reproducing the Bug

<!-- The command string you used, with full URL
(Please copy and paste within the code block below.) -->

```bash

```

## Output

<details>
<summary><code>stdout</code></summary>

<!-- stdout (the text from the terminal window)
(Please copy and paste within the code block below.) -->

```bash

```

</details>

<details>
<summary><code>errors.log</code></summary>

<!-- The errors.log file from the dump folder, if there is one
(Please copy and paste within the code block below.) -->

```text

```

</details>

## Platform Details

<!-- Please complete as much of the following as you're
able to and remove whichever section is inapplicable -->

### Desktop

- OS and version: <!-- e.g. Kubuntu 23.04, Windows 10, macOS 14.2 -->
- File system: <!-- e.g. EXT4, NTFS, APFS -->
- Python version: <!-- `$ python --version` -->
- Command line shell: <!-- `$ $SHELL --version` -->
- `dumpgenerator` version: <!-- `$ dumpgenerator -v` -->

### Smartphone or Tablet

- OS: <!-- e.g. iOS 16.1, Android 11 -->
- Python version: <!-- `$ python --version` -->
- Command line shell: <!-- `$ $SHELL --version` -->
- Terminal application used: <!-- e.g. Termux, Termius -->
- `dumpgenerator` version: <!-- `$ dumpgenerator -v` -->

## Additional Context

<!-- Add any other context about the problem here. -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Get help using MediaWiki Dump Generator
url: https://github.com/orgs/mediawiki-client-tools/discussions/categories/q-a
about: If you need help (other than reporting a bug), you can reach out on our Discussions Q&A.
- name: Anything else
url: https://github.com/orgs/mediawiki-client-tools/discussions
about: You can read and post in our GitHub Discussions.
43 changes: 43 additions & 0 deletions .github/workflows/test-dumpgenerator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: dumpgenerator test

on:
push:
branches: [ "python3" ]
pull_request:
branches: [ "python3" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest poetry
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# exit if there are Python syntax errors or undefined names
flake8 . --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
- name: run dumpgenerator
run: |
python -m wikiteam3.dumpgenerator -h
- name: Test with pytest
run: |
cd wikiteam3/dumpgenerator && pytest && cd ../../
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
*.pyc
testing/*.pyc
testing/dumpgenerator.py
/.tox
.pytest_cache
keys.txt
batchdownload/keys.txt
batchdownload/dumpgenerator.py
batchdownload/uploader.py
__pycache__
tests/tmp
dist/
.DS_Store
desktop.ini

.venv
.vscode
.idea
16 changes: 16 additions & 0 deletions .markdownlint.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// If you change any options here,
// please change them in .pymarkdown.jsonc
// as well!
{
"line-length": false,
"no-inline-html": {
"allowed_elements": [
"details",
"summary",
"code"
]
},
"first-line-heading": {
"front_matter_title" : "name"
}
}
65 changes: 65 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Apply to all files without commiting:
# pre-commit run --all-files
# Update this file:
# pre-commit autoupdate
default_language_version:
python: python3.8
repos:
- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
hooks:
- id: poetry-check
# - id: poetry-lock
- id: poetry-export
args: ["-f", "requirements.txt", "-o", "requirements.txt"]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: fix-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-yaml
- id: debug-statements
# - id: detect-aws-credentials
# - id: detect-private-key
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.942
# hooks:
# - id: mypy
# args: [--ignore-missing-imports]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.10.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
# additional_dependencies: [black==20.8b1]
### Needs argument for diasabling line_length
### https://github.com/jackdewinter/pymarkdown/blob/main/docs/rules/rule_md013.md
- repo: https://github.com/jackdewinter/pymarkdown
rev: v0.9.12
hooks:
- id: pymarkdown
args:
- --config=.pymarkdown.json
# - --disable-rules
# - line-length,no-inline-html
- scan
14 changes: 14 additions & 0 deletions .pymarkdown.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"plugins": {
"line-length": {
"enabled": false
},
"no-inline-html": {
"allowed_elements": "details,summary,code,!--"
},
"first-line-heading": {
"enabled": false,
"front_matter_title" : "name"
}
}
}
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
language: python
python: 2.7
python: 3.8
install:
- pip install tox
- pip install poetry
- poetry install
script:
- tox
- poetry run pytest --verbose -s
notifications:
email: false
Loading