Generate a Python package project using the Python Cookiecutter package
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

64 lines
2.0KB

  1. #!/usr/bin/env python
  2. try:
  3. from setuptools import setup
  4. except ImportError:
  5. from distutils.core import setup
  6. DESCRIPTION = "{{ cookiecutter.project_short_description }}"
  7. GITHUB_URL = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}"
  8. with open("requirements/prod.txt", encoding="utf-8") as file:
  9. requirements = file.read().split("\n")
  10. with open("requirements/test.txt", encoding="utf-8") as file:
  11. test_requirements = list(
  12. filter(
  13. lambda req: not req.startswith("-"),
  14. file.read().split("\n"),
  15. )
  16. )
  17. with open("requirements/dev.txt", encoding="utf-8") as file:
  18. dev_requirements = list(
  19. filter(
  20. lambda req: not req.startswith("-"),
  21. file.read().split("\n"),
  22. )
  23. )
  24. test_requirements.extend(requirements)
  25. dev_requirements.extend(test_requirements)
  26. with open("README.md", encoding="utf-8") as file:
  27. readme = file.read()
  28. with open("HISTORY.md", encoding="utf-8") as file:
  29. history = file.read()
  30. setup(
  31. name="{{ cookiecutter.project_slug }}",
  32. version="{{ cookiecutter.version }}",
  33. description=DESCRIPTION,
  34. long_description=readme + "\n\n" + history,
  35. long_description_content_type="text/markdown",
  36. author="{{ cookiecutter.full_name }}",
  37. author_email="{{ cookiecutter.email }}",
  38. url=GITHUB_URL,
  39. license="LGPL-3",
  40. keywords="{{ cookiecutter.project_slug }}",
  41. project_urls={"Source": GITHUB_URL},
  42. packages=[
  43. "{{ cookiecutter.project_slug }}",
  44. ],
  45. package_dir={"{{ cookiecutter.project_slug }}": "{{ cookiecutter.project_slug }}"},
  46. include_package_data=True,
  47. install_requires=requirements,
  48. extras_require={"dev": dev_requirements},
  49. tests_require=test_requirements,
  50. test_suite="tests",
  51. zip_safe=False,
  52. classifiers=[
  53. "Programming Language :: Python :: 3",
  54. "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
  55. "Operating System :: POSIX :: Linux",
  56. "Natural Language :: English",
  57. ],
  58. )