Skip to content

Commit 8351d8d

Browse files
committed
migrated to pyproject
1 parent 21b1db6 commit 8351d8d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+35
-74
lines changed

pyproject.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[project]
2+
name = "p5.libvirt_lxc_helper"
3+
readme = "README.md"
4+
version = "0.0.0"
5+
authors = [{name = "p5-vbnekit", email = "vbnekit@gmail.com"}]
6+
description = "libvirt_lxc helper tool"
7+
maintainers = [{name = "p5-vbnekit", email = "vbnekit@gmail.com"}]
8+
dependencies = ["python-magic"]
9+
license-files = ["LICENSE"]
10+
11+
[project.urls]
12+
repository = "https://github.com/p5-vbnekit/p5-python3-libvirt_lxc_helper"
13+
14+
[project.scripts]
15+
p5-libvirt_lxc_helper = "p5.libvirt_lxc_helper:entry_point"
16+
17+
[project.optional-dependencies]
18+
dev = ["pyproject-flake8"]
19+
20+
[build-system]
21+
requires = ["setuptools"]
22+
23+
[tool.pytest.ini_options]
24+
addopts = "-ra -q"
25+
testpaths = ["tests"]
26+
minversion = "6.0"
27+
28+
[tool.flake8]
29+
extend-ignore = ["E251", "E701"]
30+
max-line-length = 128
31+
32+
[tool.setuptools]
33+
package-dir = {"p5.libvirt_lxc_helper" = "src"}

setup.py

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,3 @@
1-
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
1+
from setuptools import setup
32

4-
assert "__main__" == __name__
5-
6-
7-
def _private():
8-
import os
9-
import setuptools
10-
import setuptools.command.build_py
11-
12-
def _make_long_description():
13-
with open(os.path.join(os.path.dirname(__file__), "README.md"), "r") as _stream: return _stream.read()
14-
15-
def _make_packages():
16-
_packages = setuptools.find_namespace_packages(where = "src")
17-
_packages.remove("p5")
18-
return _packages
19-
20-
class _Generators(object):
21-
@classmethod
22-
def get(cls): return tuple()
23-
24-
class _Commands(object):
25-
@staticmethod
26-
def build_py():
27-
# noinspection PyShadowingNames
28-
class _Result(setuptools.command.build_py.build_py):
29-
def run(self):
30-
# noinspection PyNoneFunctionAssignment
31-
_original_result = super().run()
32-
for _generator in _Generators.get(): _generator(command_interface = self)
33-
return _original_result
34-
35-
def get_outputs(self, *args, **kwargs):
36-
_original_result = super().get_outputs(*args, **kwargs)
37-
return (type(_original_result))((
38-
*_original_result,
39-
*[os.path.join(self.build_lib, _generated.path) for _generated in _Generators.get()]
40-
))
41-
42-
return _Result
43-
44-
def _routine(): setuptools.setup(
45-
name = "p5.libvirt_lxc_helper",
46-
url = "https://github.com/p5-vbnekit/p5-python3-libvirt_lxc_helper",
47-
license = "CC0",
48-
version = "0.0.0",
49-
author = "Nikita Pushchin",
50-
author_email = "vbnekit@gmail.com",
51-
description = "libvirt_lxc helper tool",
52-
long_description = _make_long_description(),
53-
long_description_content_type = "text/markdown",
54-
package_dir = {"": "src"},
55-
packages = _make_packages(),
56-
cmdclass = {
57-
"build_py": _Commands.build_py()
58-
},
59-
entry_points = {
60-
"console_scripts": (
61-
"p5-libvirt_lxc_helper=p5.libvirt_lxc_helper:entry_point",
62-
),
63-
},
64-
install_requires = ("python-magic", ),
65-
setup_requires = ("wheel", )
66-
)
67-
68-
class _Result(object):
69-
routine = _routine
70-
71-
return _Result
72-
73-
74-
try: _private().routine()
75-
finally: del _private
3+
if "__main__" == __name__: setup()
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)