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: optional unit_noextras session, possibly system_noextras too #1317

Open
tswast opened this issue Jan 5, 2022 · 1 comment
Open
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Jan 5, 2022

Is your feature request related to a problem? Please describe.

There have been times when a BigQuery "extra" (optional dependency) has accidentally become a required dependency. Tests did not catch this because the tests always installed all the optional dependencies it could for a given Python version.

Describe the solution you'd like

A unit_noextras session similar to the one provided here: https://github.com/googleapis/python-bigquery/blob/dcb8728c12f5ab0d7809a1b6cf72755dff973772/noxfile.py#L106

It can optionally be included in the default for projects where there is a risk of making an extra non-optional, such as with tqdm in https://github.com/googleapis/python-bigquery-pandas

Describe alternatives you've considered

One could use one of the middle Python versions to test with no extras via unit_test_extras_by_python. The minimum version should always have all extras, since that's where the constraints for testing minimum versions are expected to be.

This feels a bit arbitrary to me, though is a good workaround for now.

Additional context

@tswast
Copy link
Contributor Author

tswast commented Jan 5, 2022

Actually, in my testing with googleapis/python-bigquery-pandas#456, the "alternative" using unit_test_extras_by_python doesn't work. It tries to install with pip install -e .[], and pip says .[] is not a valid editable requirement.

Edit: including the following for now

# Workaround for https://github.com/googleapis/synthtool/issues/1317
s.replace(
    ["noxfile.py"], r'extras = "\[\]"', 'extras = ""',
)

@busunkim96 busunkim96 added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants