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

permissions= argument for patching over permission differences between 1.0 and <1.0 #4

Closed
simonw opened this issue Apr 26, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Contributor

simonw commented Apr 26, 2024

As proposed here:

from datasette_test import Datasette

ds = Datasette(
    plugin_config={"datasette-extract": "..."},
    permissions={"manage-secrets": {"id": "admin"}}
)

Where that permissions= thing uses config={"permissions": ...} for Datasette 1.0a+ and some more complex plugin-based mechanism for <1.0.

@simonw simonw added the enhancement New feature or request label Apr 26, 2024
@simonw
Copy link
Contributor Author

simonw commented Apr 26, 2024

Ran into this bug:

(Pdb) datasette.version.__version_info__
('1', '0a13')
(Pdb) datasette.version.__version_info__  < ("1", "0a8")
True

0a13 is incorrectly returning as a lower version that 0a8. Fix is to do this: https://til.simonwillison.net/python/comparing-version-numbers

from packaging.version import parse

v_1_0 = parse("1.0")
v_1_0a13 = parse("1.0a13")
v_0631 = parse("0.63.1")

@simonw simonw closed this as completed in 45789d0 Apr 26, 2024
simonw added a commit that referenced this issue Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant