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

Add docstring to __init__.py #240

Closed
wants to merge 5 commits into from
Closed

Conversation

robkam
Copy link
Member

@robkam robkam commented May 20, 2024

To try and placate CI - is this really needed here?

To try and placate CI - is this really needed here?
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

@elsiehupp
Copy link
Member

@robkam—If you're not sure why a check is failing, you can click on "Details" next to each test, and it should give you some sort of explanation.

The failure here is that the MediaWiki version in the test data is not the expected version. In other words, the site we are testing against updated to a new version of MediaWiki. I'm not sure why, but the expected version number appears to be hardcoded in the following two places:

def get_config(mediawiki_ver, api=True):
assert api == True
if mediawiki_ver == "1.39.6":
return _new_config_from_parameter(
[
"--api",
"https://testw.fandom.com/api.php",
]
)

def test_mediawiki_version_match():
with get_config("1.39.6") as config:
sess = requests.Session()
saveSiteInfo(config, sess)
with open(f"{config.path}/siteinfo.json") as f:
siteInfoJson = json.load(f)
assert siteInfoJson["query"]["general"]["generator"] == "MediaWiki 1.39.6"

This code appears to have been added by @sian1468—could you help us understand why the version is hardcoded here? And if possible could you find a way to avoid having it hardcoded? Thanks!

@sian1468
Copy link

sian1468 commented Jun 3, 2024

@elsiehupp

This code appears to have been added by @sian1468—could you help us understand why the version is hardcoded here? And if possible could you find a way to avoid having it hardcoded? Thanks!

The original owner of this code is @NyaMisty from commit f57f50f but from my understanding is code used to check if Mediawiki version from test website is match or not.

In my opinion this code should be removed as it is unnecessary to test this function is working or not.

@robkam
Copy link
Member Author

robkam commented Jun 4, 2024

I was only checking the details for pre-commit.ci - I'll close this PR as the docstring isn't the problem.

@robkam robkam closed this Jun 4, 2024
robkam added a commit that referenced this pull request Jun 4, 2024
Was discussed at #240
@robkam robkam mentioned this pull request Jun 4, 2024
@robkam
Copy link
Member Author

robkam commented Jun 4, 2024

I've (rather clumsily) tried to remove the hardcoded version check in #243 but it's not fixed the CI.

@robkam
Copy link
Member Author

robkam commented Jun 5, 2024

For now, I've just updated the version number to get it past the CI.

@robkam robkam reopened this Jun 5, 2024
Trying to get around hardcoded version to pass CI.
@sian1468 sian1468 mentioned this pull request Jun 6, 2024
@robkam
Copy link
Member Author

robkam commented Jun 6, 2024

Trying to not mess up #244

@robkam robkam closed this Jun 6, 2024
@robkam
Copy link
Member Author

robkam commented Jun 13, 2024

Fixed in #245

@robkam robkam mentioned this pull request Jun 13, 2024
randomnetcat pushed a commit that referenced this pull request Sep 23, 2024
@randomnetcat randomnetcat deleted the robkam-add-docstring-to-utils branch September 24, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants