summaryrefslogtreecommitdiff
path: root/setuptools/tests/config/test_expand.py
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge PRs #3636 #3634 #3633 #3595 #3576 #3569 #3564Anderson Bravalheri2022-10-141-0/+9
|\ \
| * | Catch an edge case in expand._assert_local()Mike Salvatore2022-09-181-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Using str.startswith() has an edge case where someone can access files outside the root directory. For example, consider the case where the root directory is "/home/user/my-package" but some secrets are stored in "/home/user/my-package-secrets". Evaluating a check that "/home/user/my-package-secrets".startswith("/home/user/my-package") will return True, but the statement's intention is that no file outside of "/home/user/my-package" can be accessed. Using pathlib.Path.resolve() and pathlib.Path.parents eliminates this edge case.
* | expand: Give bytes to ast.parse to let it discover encoding cookie.Julien Palard2022-09-271-0/+14
|/
* test_expand: Add example for annotated assignment without valueAnderson Bravalheri2022-06-191-5/+9
|
* Add support for annotated assignments to static attribute lookup.Karl Otness2022-06-181-0/+12
| | | | | | | | When walking the ast of a module, look for AnnAssign nodes in addition to Assign to support assignments with type annotations, for example. Since we have to read different attributes, split the generators into a for loop. Existing ast.Assign nodes follow the same processing as before.
* Simplify auto-discovered package_dirAnderson Bravalheri2022-04-051-1/+31
| | | | | | | | If the directory follows a src-layout-ish, try harder to make `package_dir` in the form `{"": "src"}`. This might be later important for PEP 660 (e.g. when composing pth files or symlinking the toplevel packages).
* Make sure dynamic classifiers don't fail on unexisting filesAnderson Bravalheri2022-03-251-4/+8
|
* Change tests for resolve_class to consider different layoutsAnderson Bravalheri2022-03-241-5/+16
| | | | | Although this situation is different from the one described in #3000, that issue served as inspiration behind this change.
* Add unit test for read_attrAnderson Bravalheri2022-03-241-24/+44
| | | | Closes #3176
* Allow expand.find_packges to fill package_dirAnderson Bravalheri2022-03-091-3/+8
|
* Find namespaces by default when using config in 'pyproject.toml'Anderson Bravalheri2022-03-051-2/+3
|
* Parametrize test_expand.test_find_packagesAnderson Bravalheri2022-03-051-15/+16
|
* Ensure proper exception matching in test_expandAnderson Bravalheri2022-03-051-2/+3
|
* Replace pushd with monkeypatch.chdir in test_expandAnderson Bravalheri2022-03-051-13/+19
|
* Adopt review suggestionsAnderson Bravalheri2022-03-051-1/+1
| | | | Co-authored-by: Sviatoslav Sydorenko <wk.cvs.github@sydorenko.org.ua>
* Allow root_dir to be explicit in config.expand functionsAnderson Bravalheri2022-03-051-7/+30
|
* Extract post-processing functions from configAnderson Bravalheri2022-03-051-0/+83
We can split the process of interpreting configuration files into 2 steps: 1. The parsing the file contents from strings to value objects that can be understand by Python (for example a string with a comma separated list of keywords into an actual Python list of strings). 2. The expansion (or post-processing) of these values according to the semantics ``setuptools`` assign to them (for example a configuration field with the ``file:`` directive should be expanded from a list of file paths to a single string with the contents of those files concatenated) The idea of this change is to extract the functions responsible for (2.) into a new module, so they can be reused between different config file formats.