This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
31d8175
commit d9109a8
Showing
30 changed files
with
3,013 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
- pre-commit-ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: check | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: "main" | ||
tags-ignore: ["**"] | ||
pull_request: | ||
schedule: | ||
- cron: "0 8 * * *" | ||
|
||
concurrency: | ||
group: check-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: test ${{ matrix.py }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
py: | ||
- "3.12" | ||
- "3.11" | ||
- "3.10" | ||
- "3.9" | ||
- "3.8" | ||
- "3.7" | ||
- "pypy3.10" | ||
- "pypy3.7" | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
- macos-latest | ||
steps: | ||
- name: Setup python for tox | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Setup python for test ${{ matrix.py }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.py }} | ||
- name: Setup test suite | ||
run: tox r -e ${{ matrix.py }} --skip-missing-interpreters false -vv --notest | ||
env: | ||
FORCE_COLOR: "1" | ||
- name: Run test suite | ||
run: tox r -e ${{ matrix.py }} --skip-missing-interpreters false --skip-pkg-install | ||
env: | ||
FORCE_COLOR: "1" | ||
PYTEST_ADDOPTS: "-vv --durations=20" | ||
CI_RUN: "yes" | ||
DIFF_AGAINST: HEAD | ||
|
||
check: | ||
name: tox env ${{ matrix.tox_env }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tox_env: | ||
- type | ||
- dev | ||
- docs | ||
- pkg_meta | ||
os: | ||
- ubuntu-latest | ||
- windows-latest | ||
exclude: | ||
- { os: windows-latest, tox_env: pkg_meta } # would be the same | ||
- { os: ubuntu-latest, tox_env: docs } # runs on readthedocs.org already | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install tox | ||
run: python -m pip install tox | ||
- name: Run check for ${{ matrix.tox_env }} | ||
run: tox -e ${{ matrix.tox_env }} | ||
env: | ||
UPGRADE_ADVISORY: "yes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Release to PyPI | ||
on: | ||
push: | ||
tags: ["*"] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/pyproject-api | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Install build | ||
run: python -m pip install build | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build package | ||
run: pyproject-build -s -w . -o dist | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
*.py[cod] | ||
*.swp | ||
__pycache__ | ||
/src/py_discovery/_version.py | ||
build | ||
dist | ||
*.egg-info | ||
.tox | ||
/.*_cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.1.7" | ||
hooks: | ||
- id: ruff-format | ||
- id: ruff | ||
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] | ||
- repo: https://github.com/tox-dev/tox-ini-fmt | ||
rev: "1.3.1" | ||
hooks: | ||
- id: tox-ini-fmt | ||
args: ["-p", "fix"] | ||
- repo: https://github.com/tox-dev/pyproject-fmt | ||
rev: "1.5.3" | ||
hooks: | ||
- id: pyproject-fmt | ||
additional_dependencies: ["tox>=4.11.4"] | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: 1.16.0 | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.11] | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.10.0 | ||
hooks: | ||
- id: rst-backticks | ||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
- id: check-useless-excludes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: 2 | ||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.12" | ||
commands: | ||
- pip install tox | ||
- tox r -e docs -- "${READTHEDOCS_OUTPUT}"/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making | ||
participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, | ||
disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, | ||
religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
- Using welcoming and inclusive language | ||
- Being respectful of differing viewpoints and experiences | ||
- Gracefully accepting constructive criticism | ||
- Focusing on what is best for the community | ||
- Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
- The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
- Trolling, insulting/derogatory comments, and personal or political attacks | ||
- Public or private harassment | ||
- Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
- Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take | ||
appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, | ||
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any | ||
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the | ||
project or its community. Examples of representing a project or community include using an official project e-mail | ||
address, posting via an official social media account, or acting as an appointed representative at an online or offline | ||
event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at | ||
[email protected]. The project team will review and investigate all complaints, and will respond in a way that it deems | ||
appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter | ||
of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent | ||
repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at | ||
[https://www.contributor-covenant.org/version/1/4/code-of-conduct.html][version] | ||
|
||
[homepage]: https://www.contributor-covenant.org/ | ||
[version]: https://www.contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Permission is hereby granted, free of charge, to any person obtaining a | ||
copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included | ||
in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
# py-discovery | ||
# [`py-discovery`](https://py-discovery.readthedocs.io/en/latest/) | ||
|
||
[![PyPI](https://img.shields.io/pypi/v/py-discovery?style=flat-square)](https://pypi.org/project/py-discovery/) | ||
[![Supported Python | ||
versions](https://img.shields.io/pypi/pyversions/py-discovery.svg)](https://pypi.org/project/py-discovery/) | ||
[![Downloads](https://static.pepy.tech/badge/py-discovery/month)](https://pepy.tech/project/py-discovery) | ||
[![check](https://github.com/tox-dev/py-discovery/actions/workflows/check.yml/badge.svg)](https://github.com/tox-dev/py-discovery/actions/workflows/check.yml) | ||
[![Documentation Status](https://readthedocs.org/projects/py-discovery/badge/?version=latest)](https://py-discovery.readthedocs.io/en/latest/?badge=latest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# noqa: D100 | ||
from __future__ import annotations | ||
|
||
from py_discovery import __version__ | ||
|
||
project = name = "py_discovery" | ||
company = "tox-dev" | ||
copyright = f"{company}" # noqa: A001 | ||
version, release = __version__, __version__.split("+")[0] | ||
|
||
extensions = [ | ||
"sphinx.ext.autosectionlabel", | ||
"sphinx.ext.extlinks", | ||
"sphinx.ext.autodoc", | ||
"sphinx_autodoc_typehints", | ||
"sphinx.ext.viewcode", | ||
"sphinx.ext.intersphinx", | ||
] | ||
master_doc, source_suffix = "index", ".rst" | ||
|
||
html_theme = "furo" | ||
html_title, html_last_updated_fmt = "py-discovery docs", "%Y-%m-%dT%H:%M:%S" | ||
pygments_style, pygments_dark_style = "sphinx", "monokai" | ||
|
||
autoclass_content, autodoc_typehints = "both", "none" | ||
autodoc_default_options = {"members": True, "member-order": "bysource", "undoc-members": True, "show-inheritance": True} | ||
inheritance_alias = {} | ||
|
||
extlinks = { | ||
"issue": ("https://github.com/tox-dev/py-discovery/issues/%s", "#%s"), | ||
"pull": ("https://github.com/tox-dev/py-discovery/pull/%s", "PR #%s"), | ||
"user": ("https://github.com/%s", "@%s"), | ||
} | ||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3", None), | ||
"packaging": ("https://packaging.pypa.io/en/latest", None), | ||
} | ||
|
||
nitpicky = True | ||
nitpick_ignore = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
``py-discovery`` | ||
================= | ||
|
||
``py-discovery`` aims to abstract away discovering Python interpreters on a user machine. | ||
|
||
API | ||
+++ | ||
|
||
.. currentmodule:: py_discovery | ||
|
||
.. autodata:: __version__ | ||
|
||
.. automodule:: py_discovery | ||
:members: | ||
:undoc-members: | ||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
self |
Oops, something went wrong.