summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pre-commit-config.yaml1
-rw-r--r--pyproject.toml79
-rw-r--r--requirements-lint.txt1
-rw-r--r--setup.cfg6
-rw-r--r--setup.py56
5 files changed, 67 insertions, 76 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 3ecf59c..aac2eec 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -37,4 +37,3 @@ repos:
additional_dependencies:
- types-PyYAML==6.0.11
- types-requests==2.28.6
- - types-setuptools==57.4.18
diff --git a/pyproject.toml b/pyproject.toml
index 3bbe356..77f6b2c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,3 +1,63 @@
+[build-system]
+requires = ["setuptools>=61.0.0"]
+build-backend = "setuptools.build_meta"
+
+[project]
+name = "python-gitlab"
+description="A python wrapper for the GitLab API"
+readme = "README.rst"
+authors = [
+ {name = "Gauvain Pocentek", email= "gauvain@pocentek.net"}
+]
+maintainers = [
+ {name = "John Villalovos", email="john@sodarock.com"},
+ {name = "Max Wittig", email="max.wittig@siemens.com"},
+ {name = "Nejc Habjan", email="nejc.habjan@siemens.com"},
+ {name = "Roger Meier", email="r.meier@siemens.com"}
+]
+requires-python = ">=3.7.0"
+dependencies = [
+ "requests>=2.25.0",
+ "requests-toolbelt>=0.9.1"
+]
+classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Environment :: Console",
+ "Intended Audience :: System Administrators",
+ "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
+ "Natural Language :: English",
+ "Operating System :: POSIX",
+ "Operating System :: Microsoft :: Windows",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.7",
+ "Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
+ "Programming Language :: Python :: 3.10"
+]
+keywords = ["api", "client", "gitlab", "python", "python-gitlab", "wrapper"]
+license = {file = "COPYING"}
+dynamic = ["version"]
+
+[project.optional-dependencies]
+autocompletion = ["argcomplete>=1.10.0,<3"]
+yaml = ["PyYaml>=5.2"]
+
+[project.scripts]
+gitlab = "gitlab.cli:main"
+
+[project.urls]
+Homepage = "https://github.com/python-gitlab/python-gitlab"
+Changelog = "https://github.com/python-gitlab/python-gitlab/blob/main/CHANGELOG.md"
+Documentation = "https://python-gitlab.readthedocs.io"
+Source = "https://github.com/python-gitlab/python-gitlab"
+
+[tool.setuptools.packages.find]
+exclude = ["docs*", "tests*"]
+
+[tool.setuptools.dynamic]
+version = { attr = "gitlab._version.__version__" }
+
[tool.isort]
profile = "black"
multi_line_output = 3
@@ -6,24 +66,7 @@ order_by_type = false
[tool.mypy]
files = "."
exclude = "build/.*"
-
-# 'strict = true' is equivalent to the following:
-check_untyped_defs = true
-disallow_any_generics = true
-disallow_incomplete_defs = true
-disallow_subclassing_any = true
-disallow_untyped_decorators = true
-disallow_untyped_defs = true
-no_implicit_optional = true
-no_implicit_reexport = true
-strict_equality = true
-warn_redundant_casts = true
-warn_return_any = true
-warn_unused_configs = true
-warn_unused_ignores = true
-
-# The following need to have changes made to be able to enable them:
-# disallow_untyped_calls = true
+strict = true
[[tool.mypy.overrides]] # Overrides for currently untyped modules
module = [
diff --git a/requirements-lint.txt b/requirements-lint.txt
index 7555b53..db832e9 100644
--- a/requirements-lint.txt
+++ b/requirements-lint.txt
@@ -8,4 +8,3 @@ pylint==2.14.5
pytest==7.1.2
types-PyYAML==6.0.11
types-requests==2.28.6
-types-setuptools==57.4.18
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..49c646d
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,6 @@
+# Placeholder for editable installs.
+#
+# Ideally, we would delete this and use only pyproject.toml.
+# Once PEP 660 has been fully stable in setuptools for a while, we can remove this.
+# https://github.com/pypa/setuptools/pull/3488
+# https://peps.python.org/pep-0660/
diff --git a/setup.py b/setup.py
deleted file mode 100644
index bb90c19..0000000
--- a/setup.py
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-from setuptools import find_packages, setup
-
-
-def get_version() -> str:
- version = ""
- with open("gitlab/_version.py", "r", encoding="utf-8") as f:
- for line in f:
- if line.startswith("__version__"):
- version = eval(line.split("=")[-1])
- break
- return version
-
-
-with open("README.rst", "r", encoding="utf-8") as f:
- readme = f.read()
-
-setup(
- name="python-gitlab",
- version=get_version(),
- description="Interact with GitLab API",
- long_description=readme,
- long_description_content_type="text/x-rst",
- author="Gauvain Pocentek",
- author_email="gauvain@pocentek.net",
- license="LGPLv3",
- url="https://github.com/python-gitlab/python-gitlab",
- packages=find_packages(exclude=["docs*", "tests*"]),
- install_requires=["requests>=2.25.0", "requests-toolbelt>=0.9.1"],
- package_data={
- "gitlab": ["py.typed"],
- },
- python_requires=">=3.7.0",
- entry_points={"console_scripts": ["gitlab = gitlab.cli:main"]},
- classifiers=[
- "Development Status :: 5 - Production/Stable",
- "Environment :: Console",
- "Intended Audience :: System Administrators",
- "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
- "Natural Language :: English",
- "Operating System :: POSIX",
- "Operating System :: Microsoft :: Windows",
- "Programming Language :: Python",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.7",
- "Programming Language :: Python :: 3.8",
- "Programming Language :: Python :: 3.9",
- "Programming Language :: Python :: 3.10",
- ],
- extras_require={
- "autocompletion": ["argcomplete>=1.10.0,<3"],
- "yaml": ["PyYaml>=5.2"],
- },
-)