| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 59d6a88 commit 71fca8c
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -40,7 +40,6 @@ repos: | |||
| 40 | 40 | - responses==0.23.1 | |
| 41 | 41 | - types-PyYAML==6.0.12 | |
| 42 | 42 | - types-requests==2.28.11.2 | |
| 43 | - - types-setuptools==65.5.0.1 | ||
| 44 | 43 | - repo: https://github.com/pre-commit/pygrep-hooks | |
| 45 | 44 | rev: v1.10.0 | |
| 46 | 45 | hooks: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ FROM python:3.11-${PYTHON_FLAVOR} AS build | |||
| 3 | 3 | ||
| 4 | 4 | WORKDIR /opt/python-gitlab | |
| 5 | 5 | COPY . . | |
| 6 | - RUN python setup.py bdist_wheel | ||
| 6 | + RUN pip install build && python -m build | ||
| 7 | 7 | ||
| 8 | 8 | FROM python:3.11-${PYTHON_FLAVOR} | |
| 9 | 9 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,63 @@ | |||
| 1 | + [build-system] | ||
| 2 | + requires = ["setuptools>=61.0.0"] | ||
| 3 | + build-backend = "setuptools.build_meta" | ||
| 4 | + | ||
| 5 | + [project] | ||
| 6 | + name = "python-gitlab" | ||
| 7 | + description="A python wrapper for the GitLab API" | ||
| 8 | + readme = "README.rst" | ||
| 9 | + authors = [ | ||
| 10 | + {name = "Gauvain Pocentek", email= "gauvain@pocentek.net"} | ||
| 11 | + ] | ||
| 12 | + maintainers = [ | ||
| 13 | + {name = "John Villalovos", email="john@sodarock.com"}, | ||
| 14 | + {name = "Max Wittig", email="max.wittig@siemens.com"}, | ||
| 15 | + {name = "Nejc Habjan", email="nejc.habjan@siemens.com"}, | ||
| 16 | + {name = "Roger Meier", email="r.meier@siemens.com"} | ||
| 17 | + ] | ||
| 18 | + requires-python = ">=3.8.0" | ||
| 19 | + dependencies = [ | ||
| 20 | + "requests>=2.25.0", | ||
| 21 | + "requests-toolbelt>=0.10.1", | ||
| 22 | + ] | ||
| 23 | + classifiers = [ | ||
| 24 | + "Development Status :: 5 - Production/Stable", | ||
| 25 | + "Environment :: Console", | ||
| 26 | + "Intended Audience :: System Administrators", | ||
| 27 | + "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", | ||
| 28 | + "Natural Language :: English", | ||
| 29 | + "Operating System :: POSIX", | ||
| 30 | + "Operating System :: Microsoft :: Windows", | ||
| 31 | + "Programming Language :: Python", | ||
| 32 | + "Programming Language :: Python :: 3", | ||
| 33 | + "Programming Language :: Python :: 3.8", | ||
| 34 | + "Programming Language :: Python :: 3.9", | ||
| 35 | + "Programming Language :: Python :: 3.10", | ||
| 36 | + "Programming Language :: Python :: 3.11" | ||
| 37 | + ] | ||
| 38 | + keywords = ["api", "client", "gitlab", "python", "python-gitlab", "wrapper"] | ||
| 39 | + license = {text = "LGPL-3.0-or-later"} | ||
| 40 | + dynamic = ["version"] | ||
| 41 | + | ||
| 42 | + [project.optional-dependencies] | ||
| 43 | + autocompletion = ["argcomplete>=1.10.0,<3"] | ||
| 44 | + yaml = ["PyYaml>=6.0.1"] | ||
| 45 | + | ||
| 46 | + [project.scripts] | ||
| 47 | + gitlab = "gitlab.cli:main" | ||
| 48 | + | ||
| 49 | + [project.urls] | ||
| 50 | + Homepage = "https://github.com/python-gitlab/python-gitlab" | ||
| 51 | + Changelog = "https://github.com/python-gitlab/python-gitlab/blob/main/CHANGELOG.md" | ||
| 52 | + Documentation = "https://python-gitlab.readthedocs.io" | ||
| 53 | + Source = "https://github.com/python-gitlab/python-gitlab" | ||
| 54 | + | ||
| 55 | + [tool.setuptools.packages.find] | ||
| 56 | + exclude = ["docs*", "tests*"] | ||
| 57 | + | ||
| 58 | + [tool.setuptools.dynamic] | ||
| 59 | + version = { attr = "gitlab._version.__version__" } | ||
| 60 | + | ||
| 1 | 61 | [tool.isort] | |
| 2 | 62 | profile = "black" | |
| 3 | 63 | multi_line_output = 3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,5 +7,4 @@ pytest-github-actions-annotate-failures==0.2.0 | |||
| 7 | 7 | pytest==7.4.2 | |
| 8 | 8 | PyYaml==6.0.1 | |
| 9 | 9 | responses==0.23.3 | |
| 10 | - setuptools==68.2.2 | ||
| 11 | 10 | wheel==0.41.2 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,34 +1,40 @@ | |||
| 1 | 1 | import tarfile | |
| 2 | 2 | import zipfile | |
| 3 | + import subprocess | ||
| 4 | + import sys | ||
| 3 | 5 | from pathlib import Path | |
| 4 | - from sys import version_info | ||
| 6 | + | ||
| 5 | 7 | ||
| 6 | 8 | import pytest | |
| 7 | - from setuptools import sandbox | ||
| 8 | 9 | ||
| 9 | 10 | from gitlab._version import __title__, __version__ | |
| 10 | 11 | ||
| 11 | - DIST_DIR = Path("dist") | ||
| 12 | 12 | DOCS_DIR = "docs" | |
| 13 | 13 | TEST_DIR = "tests" | |
| 14 | 14 | SDIST_FILE = f"{__title__}-{__version__}.tar.gz" | |
| 15 | - WHEEL_FILE = ( | ||
| 16 | - f"{__title__.replace('-', '_')}-{__version__}-py{version_info.major}-none-any.whl" | ||
| 17 | - ) | ||
| 15 | + WHEEL_FILE = f"{__title__.replace('-', '_')}-{__version__}-py{sys.version_info.major}-none-any.whl" | ||
| 16 | + | ||
| 17 | + | ||
| 18 | + @pytest.fixture(scope="session") | ||
| 19 | + def build(tmp_path_factory: Path): | ||
| 20 | + temp_dir = tmp_path_factory.mktemp("build") | ||
| 21 | + subprocess.run([sys.executable, "-m", "build", "--outdir", temp_dir], check=True) | ||
| 22 | + return temp_dir | ||
| 18 | 23 | ||
| 19 | 24 | ||
| 20 | - @pytest.fixture(scope="function") | ||
| 21 | - def build() -> None: | ||
| 22 | - sandbox.run_setup("setup.py", ["--quiet", "clean", "--all"]) # type: ignore[no-untyped-call] | ||
| 23 | - sandbox.run_setup("setup.py", ["--quiet", "sdist", "bdist_wheel"]) # type: ignore[no-untyped-call] | ||
| 25 | + def test_sdist_includes_docs_and_tests(build: subprocess.CompletedProcess) -> None: | ||
| 26 | + sdist = tarfile.open(build / SDIST_FILE, "r:gz") | ||
| 27 | + sdist_dir = f"{__title__}-{__version__}" | ||
| 24 | 28 | ||
| 29 | + docs_dir = sdist.getmember(f"{sdist_dir}/{DOCS_DIR}") | ||
| 30 | + test_dir = sdist.getmember(f"{sdist_dir}/{TEST_DIR}") | ||
| 31 | + readme = sdist.getmember(f"{sdist_dir}/README.rst") | ||
| 25 | 32 | ||
| 26 | - def test_sdist_includes_tests(build): | ||
| 27 | - sdist = tarfile.open(DIST_DIR / SDIST_FILE, "r:gz") | ||
| 28 | - test_dir = sdist.getmember(f"{__title__}-{__version__}/{TEST_DIR}") | ||
| 33 | + assert docs_dir.isdir() | ||
| 29 | 34 | assert test_dir.isdir() | |
| 35 | + assert readme.isfile() | ||
| 30 | 36 | ||
| 31 | 37 | ||
| 32 | - def test_wheel_excludes_docs_and_tests(build): | ||
| 33 | - wheel = zipfile.ZipFile(DIST_DIR / WHEEL_FILE) | ||
| 38 | + def test_wheel_excludes_docs_and_tests(build: subprocess.CompletedProcess) -> None: | ||
| 39 | + wheel = zipfile.ZipFile(build / WHEEL_FILE) | ||
| 34 | 40 | assert not any(file.startswith((DOCS_DIR, TEST_DIR)) for file in wheel.namelist()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -65,9 +65,10 @@ commands = | |||
| 65 | 65 | [testenv:twine-check] | |
| 66 | 66 | basepython = python3 | |
| 67 | 67 | deps = -r{toxinidir}/requirements.txt | |
| 68 | + build | ||
| 68 | 69 | twine | |
| 69 | 70 | commands = | |
| 70 | - python3 setup.py sdist bdist_wheel | ||
| 71 | + python -m build | ||
| 71 | 72 | twine check dist/* | |
| 72 | 73 | ||
| 73 | 74 | [testenv:venv] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments