Ensure user account belongs to bot group: see wiki page Special:UserRights
Create a bot password in wiki page: Special:BotPasswords
copy wikidetails.template.yml
as wikidetails.yml
and fill in bot name and password:
cp wikidetails.template.yml wikidetails.yml
python setup.py bdist_wheel
pip install path/to/mediawikitools/dist/mediawikitools-0.1.0-py3-none-any.whl
Ensure: wikidetails.yml
is in the root dir of the new script
from mediawikitools.wiki import actions
actions.edit(page='Test', content='test from another script')
tox
will run tests and detect flake8s
python -m pytest
will run the tests/test*.py
pytest optional aguments
python -m pytest -m read
- Second
-m
stands for marker; currently test use markers: read, write -s
show print statements as they are executed in stdout--log-cli-level
log level. Option: DEBUG, INFO Default: INFO.
flake8 somefile
lint checks