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

Python bootstrap #154

Merged
merged 19 commits into from
Dec 22, 2023
Merged

Python bootstrap #154

merged 19 commits into from
Dec 22, 2023

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented Dec 19, 2023

⚠️ Trusted publishing configuration needed for PyPi

Rationale

Fix #153

Changes

  • migration to bootstrap conventions (hatch, ruff, pyright, pre-commit, Github workflows, Dockerfile)
  • migrate to Python 3.11 instead of 3.8
  • migrate to scraperlib 2.1 (latest before 3.x)
  • activate stale bot
  • add convenient pull requests template

@benoit74 benoit74 self-assigned this Dec 19, 2023
@benoit74 benoit74 force-pushed the python_bootstrap branch 2 times, most recently from 54164cc to bc1c332 Compare December 19, 2023 15:46
Copy link

codecov bot commented Dec 19, 2023

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

@benoit74 benoit74 marked this pull request as ready for review December 19, 2023 16:36
@benoit74 benoit74 requested a review from rgaudin December 19, 2023 16:36
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

There's no explanation on why this is not using scraperlib 3.x.
Do you want to do it in two steps? Then we can't close the ticket with this PR IMO.

.github/pull_request_template.yml Outdated Show resolved Hide resolved
.github/stale.yml Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
src/ted2zim/multi/scraper.py Outdated Show resolved Hide resolved
src/ted2zim/scraper.py Outdated Show resolved Hide resolved
src/ted2zim/scraper.py Outdated Show resolved Hide resolved
src/ted2zim/scraper.py Outdated Show resolved Hide resolved
)
raise ValueError("Wrong topic(s) were supplied. No videos found")

def run(self):
logger.info(
f"Starting scraper with:\n"
f" langs: {', '.join(self.source_languages)}\n"
f" subtitles : {', '.join(self.subtitles_setting) if isinstance(self.subtitles_setting, list) else self.subtitles_setting}\n"
f" subtitles : { ', '.join(self.subtitles_setting) if isinstance(self.subtitles_setting, list) else self.subtitles_setting}\n" # noqa: E501
Copy link
Member

Choose a reason for hiding this comment

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

Why a space at begining of expr in f-string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was like that before I came ; looks like this is some sort of identations to make stuff more readable.

Copy link
Member

Choose a reason for hiding this comment

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

Well It's unbalanced so it's incorrect anyway. Our convention is to not use spaces here (see line above) so I think it should be fixed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, we weren't speaking about the same space ; this one is weird, you are right

@benoit74
Copy link
Collaborator Author

There's no explanation on why this is not using scraperlib 3.x.

I explained this in the issue + intended to add a link to explain this in pyproject.toml but it looks like I got interrupted

Do you want to do it in two steps? Then we can't close the ticket with this PR IMO.

Yes, I want to do this in two steps. This is why there is two tickets now (since our discussion from Tuesday), one for the bootstrap (which will be closed by this PR) and another one to update scraperlib to 3.x once we have the new flag to not check metadata in multi mode.

@benoit74 benoit74 requested a review from rgaudin December 21, 2023 10:34
@benoit74
Copy link
Collaborator Author

@rgaudin did you configured Trusted publishing for this repo as well?

@benoit74
Copy link
Collaborator Author

Oups, I forgot to push, this is why the CI is still all green 🤣

@benoit74
Copy link
Collaborator Author

Commits pushed and CI all green, sorry for that

@benoit74
Copy link
Collaborator Author

I just realized that we should answer to openzim/overview#13 (comment) before merging this.

@benoit74
Copy link
Collaborator Author

I forgot to update README.md to use hatch + harmonize badges, that's done now.

@rgaudin
Copy link
Member

rgaudin commented Dec 22, 2023

@rgaudin did you configured Trusted publishing for this repo as well?

I did

Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

👍 please change those minor stuff directly and merge

@benoit74 benoit74 merged commit 0c2d924 into main Dec 22, 2023
7 checks passed
@benoit74 benoit74 deleted the python_bootstrap branch December 22, 2023 16:49
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.

Adopt Python boostrap convention and upgrade dependencies
2 participants