Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to pyproject.toml for package creation #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Version 3.1, 2023-12-20

Switch to pyproject.toml for building the package


Version 3.0, 2020-12-20

Initial changelog
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools", "setuptools_scm[toml]"]
build-backend = "setuptools.build_meta"

[project]
name = "privacyideaadm"
dynamic = ["version"]
description = 'privacyIDEA admin Client'
authors = [
{name = "Cornelius Kölbel", email = "[email protected]"},
]
readme = {file = "README.md", content-type = "text/markdown"}
requires-python = ">=3.7"
keywords = ["2fa", "mfa", "privacyIDEA", "Yubikey", "Nitrokey"]
license = {text = "AGPL-3.0-only"}
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU Affero General Public License v3"
]

dependencies = [
"cffi",
"click",
"cryptography",
"python-yubico",
"qrcode",
"requests",
"six"
]

[project.optional-dependencies]
doc = ["sphinx"]
dev = ["pytest"]

[project.urls]
homepage = "https://www.privacyidea.org"
repository = "https://github.com/privacyidea/privacyideaadm.git"
changelog = "https://github.com/privacyidea/privacyideaadm/Changelog"

[tool.setuptools_scm]
27 changes: 14 additions & 13 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
certifi==2020.6.20
cffi==1.14.0
chardet==3.0.4
click==7.1.2
cryptography==2.9.2
idna==2.10
pycparser==2.20
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.3
cryptography==40.0.2
idna==3.4
pycparser==2.21
pypng==0.20220715.0
python-yubico==1.3.3
pyusb==1.0.2
qrcode==6.1
requests==2.24.0
six==1.15.0
sphinx==6.1.3
urllib3==1.25.9
pyusb==1.2.1
qrcode==7.4.2
requests==2.28.2
six==1.16.0
typing_extensions==4.5.0
urllib3==1.26.15
10 changes: 0 additions & 10 deletions setup.cfg

This file was deleted.

85 changes: 13 additions & 72 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,75 +1,16 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
from setuptools import setup
from setuptools.command.install import install
import os
import sys

version = "3.0"
name = 'privacyideaadm'
release = '3.0'

# Taken from kennethreitz/requests/setup.py
package_directory = os.path.realpath(os.path.dirname(__file__))


class InstallWithDoc(install):
def run(self):
self.run_command('build_sphinx')
install.run(self)


cmdclass = {'install': InstallWithDoc}


def get_file_contents(file_path):
"""Get the context of the file using full path name."""
content = ""
try:
full_path = os.path.join(package_directory, file_path)
content = open(full_path, 'r').read()
except:
print("### could not open file {0!r}".format(file_path), file=sys.stderr)
return content


setup(name=name,
version=version,
description='privacyIDEA admin Client',
author='Cornelius Kölbel',
author_email='[email protected]',
url='http://www.privacyidea.org',
packages=['privacyideautils',
'privacyideautils.commands'],
setup_requires=['sphinx <= 1.8.5;python_version<"3.0"',
'sphinx >= 2.0;python_version>="3.0"'],
install_requires=[
"cffi",
"click",
"cryptography",
"python-yubico",
"qrcode",
"requests",
"six"
],
cmdclass=cmdclass,
command_options={
'build_sphinx': {
'project': ('setup.py', name),
'version': ('setup.py', version),
'source_dir': ('setup.py', 'doc'),
'build_dir': ('setup.py', os.path.join('doc', '_build')),
'builder': ('setup.py', 'man')
}
},
scripts=['scripts/privacyidea',
'scripts/privacyidea-luks-assign',
'scripts/privacyidea-authorizedkeys',
'scripts/privacyidea-check-offline-otp',
'scripts/privacyidea-get-offline-otp',
'scripts/privacyidea-validate',
'scripts/privacyidea-enroll-yubikey-piv'],
data_files=[('share/man/man1', ["doc/_build/man/privacyidea.1"])],
license='AGPLv3',
long_description=get_file_contents('DESCRIPTION')
)
setup(
packages=['privacyideautils',
'privacyideautils.commands'],
scripts=[
'scripts/privacyidea',
'scripts/privacyidea-luks-assign',
'scripts/privacyidea-authorizedkeys',
'scripts/privacyidea-check-offline-otp',
'scripts/privacyidea-get-offline-otp',
'scripts/privacyidea-validate',
'scripts/privacyidea-enroll-yubikey-piv'
]
)