- Oct 11, 2024
-
-
Marc Troelitzsch authored
-
Marc Troelitzsch authored
ubuntu-latest is in the process of being updated from ubuntu-22.04 to ubuntu-24.04, which leads to issues with py37: ``` Version 3.7 was not found in the local cache Error: The version '3.7' with architecture 'x64' was not found for Ubuntu 24.04. ``` This commit hard-codes the ubuntu-version for py37 to ubuntu-22.04, similar to what we've done for py36. See https://github.com/actions/runner-images/issues/10636 for more information.
-
- Oct 10, 2024
-
-
Marc Troelitzsch authored
The flake8 section is the only one left, so might as well rename the file.
-
Marc Troelitzsch authored
To keep build-compatibility with Python 3.6, I've switched the build backend from `setuptools` to `hatchling`. `setuptools` only supports `pyproject.toml` from version 61 onwards, which itself isn't compatible with Python 3.6. This does not mean we have to fully use Hatch as we can still create build using `python -m build`. Hatchling automatically includes all non-gitignored files, so the `MANIFEST.in` file has been removed.
-
NDKDD authored
-
NDKDD authored
-
NDKDD authored
-
NDKDD authored
-
NDKDD authored
-
- Oct 05, 2024
-
-
Marc Trölitzsch authored
-
- Sep 29, 2024
-
-
Marc Troelitzsch authored
-
- Sep 28, 2024
-
-
Marc Troelitzsch authored
Renaming `types.py` to `_types.py` to avoid conflicts with Python's built-in modules. This change addresses some `ImportErrors` such as: ``` ImportError: cannot import name 'MappingProxyType' from partially initialized module 'types' (most likely due to a circular import) ``` As far as I can tell this is not a problem when installing the library using pip or running tests in tox, only local execution when adding the source-root to the `PYTHONPATH`. This is e.g. the case in the default IntelliJ/Pycharm run configuration when testing in scratch files.
-
Marc Trölitzsch authored
-
- Sep 27, 2024
-
- Sep 16, 2024
-
-
Marc Troelitzsch authored
-
Marc Troelitzsch authored
-
Marc Troelitzsch authored
Previously only `mwclient.errors.InsufficientPermission` was included
-
Marc Troelitzsch authored
The logic for this was removed in cd4830a5, seems like the error was forgotten at the time.
-
Marc Troelitzsch authored
-
- Sep 05, 2024
-
-
Marc Troelitzsch authored
-
Marc Troelitzsch authored
Non-integers in these positions would lead to issues when comparing versions, e.g. `self.version[:2] > (1, 27)`.
-
Marc Troelitzsch authored
In the examples in the MediaWiki documentation, versions are compared using the `version_compare` function from the PHP standard library: https://www.mediawiki.org/wiki/Manual:$wgVersion#Example_code Before comparison, this version canonicalizes version strings according to the following rules: - Replace _, - and + with a dot . - Insert dots . before and after any non number This commit updates `Site.version_tuple_from_generator` to parse versions according to those rules.
-
Marc Troelitzsch authored
-
- Sep 01, 2024
-
-
Adam Williamson authored
100%, baby Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This fallback seems broken and weird. I can't see why: 1) We do it at all 2) Given that we do it, we do it only for namespace IDs in site.namespaces It's existed since the first version of mwclient, but I really can't see how it's valid. A `Site` instance's `self.namespaces` starts out as `default_namespaces`, then in `site_init`, we read in the real namespace configuration of the specific wiki. If the wiki changes the default namespaces, we should respect that. So it seems to me we should just trust `self.namespaces`. I don't see how any kind of fallback to `self.default_namespaces` is ever going to give a more useful result than not doing it. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This covers missing statements in the PageList class. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This covers some uncovered statements in the Category class. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
I had to invent the API response because this is only used for the CheckUser extension and I don't have enough privileges to actually use that extension on any wiki with it installed, but I'm pretty sure this more or less captures what it's meant to do. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This covers the `List.__repr__` method. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This covers the `if self.result_member not in data['query']` branch of `set_iter`. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
new-style continuation is available since 1.21, and we are already forcing it for mw 1.21-1.25 in `api` by adding `continue` to kwargs if it's not there. Old-style continuation is only available by passing `rawcontinue=` and is not recommended. I don't think we need to maintain support for it in the List class. Theoretically it could maybe still be used if someone is passing `rawcontinue=""` as an arg to `List` or a subclass of it (and that overrides the `continue=` that we force in - I'm not sure which wins), but I can't imagine why anyone would want to do that. This improves test coverage because old-style continuation is uncovered at present. I'd rather remove it than write a test for it. See: https://www.mediawiki.org/wiki/API:Continue Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
This covers the `if not data: raise StopIteration` bit of `load_chunk`. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
- Aug 31, 2024
-
-
Vladislav Suchkov authored
made 429 Too Many Request HTTP error in raw_call() retryable
-
- Aug 30, 2024
-
-
dependabot[bot] authored
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5.1.1 to 5.2.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/v5.1.1...v5.2.0 ) --- updated-dependencies: - dependency-name: actions/setup-python dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by:
dependabot[bot] <support@github.com>
-
- Aug 26, 2024
-
-
Adam Williamson authored
This adds an integration test that runs a set of mediawiki containers, configures them enough that the API works, then runs a few simple tests of logging in, creating, moving and deleting pages. We also enable this in CI. We can extend this with more tests later, I think this is a reasonable initial set. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
3.12 is current now. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
Adam Williamson authored
That's the current stable Python. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
- Aug 25, 2024
-
-
Marc Troelitzsch authored
The setup.py test command and pytest-runner have been deprecated for several years and are no longer recommended. The pytest documentation no longer recommends pytest-runner and their own documentation recommends against it. - https://github.com/pypa/setuptools/issues/1684 - https://github.com/pytest-dev/pytest/issues/5534 - https://github.com/pytest-dev/pytest-runner/issues/50 Changes made: - Removed pytest-runner: Eliminated the use of pytest-runner from `setup.py`. - Moved test dependencies to the `extra-dependencies`, which can be used by tox as well as for manual installation. - Updated the documentation to recommend using tox as the default test runner. Alternatively, users can manually run tests with the `py.test` command. These changes will also make an eventual migration to `pyproject.toml` easier, as the `extras_require` can be copied to the `project.optional-dependencies` section.
-
- Aug 23, 2024
-
-
Adam Williamson authored
I found this while writing integration tests. If you try to login with an incorrect username and password, mwclient correctly raises mwclient.errors.LoginError...but if you then check logged_in, it is True. Clearly that's wrong. The logic for setting logged_in will basically consider us logged in any time we process an API call and there is no 'anon' key in the userinfo dict *or there is no userinfo dict at all*. The last API call processed on a failed login attempt has no userinfo dict. This tweaks it so we only changed the logged_in value (in either direction) if the API call we're handling has a userinfo dict. We also fix the type of the empty userinfo we create if there isn't one in the call (no idea why it was a tuple, it doesn't really matter but it's weird) and explicitly set self.logged_in to False in Site initialization. I don't think this is strictly necessary as we can expect the init process to result in at least one API call with a userinfo dict, but it feels more correct. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-