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

Create manage_tx.py #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Create manage_tx.py #13

wants to merge 1 commit into from

Conversation

rffontenelle
Copy link
Owner

Draft of script to perform some operations in python-doc organization, mainly to help working on Python version bump.

from transifex.api import transifex_api

# Version number of a new versioned project to create
new_project_version = '3.11'
Copy link
Contributor

@m-aciek m-aciek Jun 4, 2023

Choose a reason for hiding this comment

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

nit: I wonder if it wouldn't be easier for usage to accept this value from script argument

it can be hard to achieve with the argument parser we have now though

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, that was my initial desire when I created it (i.e. when bumping python-newest to 3.12), but I didn't want to expend more time on argparse at the time. Any feedback is welcome

Copy link
Contributor

Choose a reason for hiding this comment

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

I think Fire (with version 1 or 4 from hello world docs) should be feasible replacement for argparse that would handle this one extra argument for selected command. Should be more minimal than e.g. Typer or Click which have more verbose API.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I liked Fire, but it looks like it is not compatible with 3.11 (and because a small fix with PR open and not merged yet). I've came across with Typer and Click before. I guess this could be a good time to play with them.

Comment on lines +77 to +87
print(f'Creating {vers_proj_name}\'s resources:')
for r in RESOURCES:
print(f'r.name ...')
transifex_api.Resource.create(
project=versioned_project,
i18n_format=r.i18n_format,
slug=r.slug,
name=r.name,
priority=r.priority,
accept_translations=True
)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Remove this workaround when sphinx-doc/sphinx-intl#90 lands in the source code and gets released.

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.

2 participants