Python functions to get top-level importables names
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #3 from astrojuanlu/update-template

Update to latest template

authored by

Juan Luis Cano Rodríguez and committed by
GitHub
(Jul 24, 2024, 11:05 AM +0200) 067eb616 94b08d48

+25 -46
+1 -1
.copier-answers.yml
··· 1 1 # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY 2 - _commit: 95f4c41 2 + _commit: v2024.03.1 3 3 _src_path: gh:astrojuanlu/copier-pylib 4 4 author_email: hello@juanlu.space 5 5 author_name: Juan Luis Cano Rodríguez
+1 -1
.pre-commit-config.yaml
··· 6 6 - id: check-merge-conflict 7 7 8 8 - repo: https://github.com/astral-sh/ruff-pre-commit 9 - rev: v0.1.6 9 + rev: v0.3.2 10 10 hooks: 11 11 - id: ruff 12 12 args: [ --fix, --exit-non-zero-on-fix ]
+10 -9
CONTRIBUTING.md
··· 7 7 8 8 ## Contributing code 9 9 10 - 1. Set up a Python development environment 10 + 1. Clone the repository 11 + 2. Set up and activate a Python development environment 11 12 (advice: use [venv](https://docs.python.org/3/library/venv.html), 12 13 [virtualenv](https://virtualenv.pypa.io/), or [miniconda](https://docs.conda.io/en/latest/miniconda.html)) 13 - 2. Install tox: `python -m pip install tox` 14 - 3. Clone the repository 15 - 4. Start a new branch off master: `git switch -c new-branch master` 16 - 5. Make your code changes 17 - 6. Check that your code follows the style guidelines of the project: `tox -e reformat && tox -e check` 18 - 7. (optional) Build the documentation: `tox -e docs` 19 - 8. (optional) Run the tests: `tox -e py39` 14 + 3. Install tox: `python -m pip install tox` 15 + 4. Make sure the tests run: `tox -e py38` 20 16 (change the version number according to the Python you are using) 21 - 9. Commit, push, and open a pull request! 17 + 5. Start a new branch: `git switch -c new-branch main` 18 + 6. Make your code changes 19 + 7. Check that your code follows the style guidelines of the project: `tox -e reformat && tox -e check` 20 + 8. Run the tests again and verify that they pass: `tox -e py38` 21 + 9. (optional) Build the documentation: `tox -e docs` 22 + 10. Commit, push, and open a pull request!
-20
docs/Makefile
··· 1 - # Minimal makefile for Sphinx documentation 2 - # 3 - 4 - # You can set these variables from the command line, and also 5 - # from the environment for the first two. 6 - SPHINXOPTS ?= 7 - SPHINXBUILD ?= sphinx-build 8 - SOURCEDIR = source 9 - BUILDDIR = build 10 - 11 - # Put it first so that "make" without argument is like "make help". 12 - help: 13 - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 - 15 - .PHONY: help Makefile 16 - 17 - # Catch-all target: route all unknown targets to Sphinx using the new 18 - # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 - %: Makefile 20 - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+1 -1
docs/source/conf.py
··· 8 8 9 9 project = _metadata["Name"] 10 10 author = _metadata["Author-email"].split("<", 1)[0].strip() 11 - copyright = f"2022, {author}" 11 + copyright = f"2023, {author}" 12 12 13 13 version = _metadata["Version"] 14 14 release = ".".join(version.split(".")[:2])
+7 -5
pyproject.toml
··· 51 51 "sphinx-copybutton", 52 52 ] 53 53 54 + [tool.pdm.version] 55 + source = "scm" 56 + 54 57 [tool.ruff] 55 58 show-fixes = true 59 + 60 + [tool.ruff.lint] 56 61 select = [ 57 62 "F", # Pyflakes 58 63 "E", # Pycodestyle ··· 63 68 "PL", # Pylint 64 69 ] 65 70 66 - [tool.pdm.version] 67 - source = "scm" 68 - 69 - [tool.ruff.per-file-ignores] 71 + [tool.ruff.lint.per-file-ignores] 70 72 "tests/**/*" = ["D", "PLR2004"] 71 73 72 - [tool.ruff.pydocstyle] 74 + [tool.ruff.lint.pydocstyle] 73 75 convention = "numpy" 74 76 75 77 [tool.mypy]
+2 -2
src/pygetimportables/__init__.py
··· 83 83 84 84 85 85 def _determine_major_import_names( 86 - importable_components: t.Iterable[tuple[str, ...]] 86 + importable_components: t.Iterable[tuple[str, ...]], 87 87 ) -> set[str]: 88 88 return {components[0] for components in importable_components} 89 89 90 90 91 91 def _get_importable_components_from_wheel( 92 - wheel: WheelSource 92 + wheel: WheelSource, 93 93 ) -> t.Iterable[tuple[str, ...]]: 94 94 metadata = parse_metadata_file(wheel.read_dist_info("WHEEL")) 95 95 if not (metadata["Wheel-Version"] and metadata["Wheel-Version"].startswith("1.")):
+3 -7
tox.ini
··· 1 1 [tox] 2 - envlist = 2 + env_list = 3 3 check 4 4 docs 5 - {py39,py310,py311,py312,pypy3}{,-coverage} 6 - # See https://tox.readthedocs.io/en/latest/example/package.html#flit 7 - isolated_build = True 8 - isolated_build_env = build 5 + {py3}{,-coverage} 9 6 10 7 [gh-actions] 11 8 python = ··· 21 18 py310: python3.10 22 19 py311: python3.11 23 20 py312: python3.12 24 - # See https://github.com/tox-dev/tox/issues/1548 25 - {check,docs,build}: python3 21 + {check,docs}: python3 26 22 setenv = 27 23 PYTHONUNBUFFERED = yes 28 24 PYTEST_EXTRA_ARGS = -s