2 # -*- coding: utf-8 -*-
4 # Note: To use the 'upload' functionality of this file, you must:
5 # $ pipenv install twine --dev
10 from shutil
import rmtree
11 from setuptools
import find_packages
, setup
, Command
15 DESCRIPTION
= 'My short description for my project.'
19 REQUIRES_PYTHON
= '>=3.6.0'
22 # What packages are required for this module to be executed?
27 'wheel', # For .exe generation under Windows
30 # What packages are optional?
32 # 'fancy feature': ['django'],
33 ':sys_platform=="win32"': ['colorama'],
34 ':sys_platform=="cygwin"': ['colorama'],
37 # The rest you shouldn't have to touch too much :)
38 # ------------------------------------------------
39 # Except, perhaps the License and Trove Classifiers!
40 # If you do change the License, remember to change the Trove Classifier for that!
42 here
= os
.path
.abspath(os
.path
.dirname(__file__
))
44 # Import the README and use it as the long-description.
45 # Note: this will only work if 'README.md' is present in your MANIFEST.in file!
47 with io
.open(os
.path
.join(here
, 'README.md'), encoding
='utf-8') as f
:
48 long_description
= '\n' + f
.read()
49 except FileNotFoundError
:
50 long_description
= DESCRIPTION
52 # Load the package's __version__.py module as a dictionary.
55 project_slug
= NAME
.lower().replace("-", "_").replace(" ", "_")
56 with
open(os
.path
.join(here
, project_slug
, '__version__.py')) as f
:
59 about
['__version__'] = VERSION
62 class UploadCommand(Command
):
63 """Support setup.py upload."""
65 description
= 'Build and publish the package.'
70 """Prints things in bold."""
71 print('\033[1m{0}\033[0m'.format(s
))
73 def initialize_options(self
):
76 def finalize_options(self
):
81 self
.status('Removing previous builds…')
82 rmtree(os
.path
.join(here
, 'dist'))
86 self
.status('Building Source and Wheel (universal) distribution…')
87 os
.system('{0} setup.py sdist bdist_wheel --universal'.format(sys
.executable
))
89 self
.status('Uploading the package to PyPI via Twine…')
90 os
.system('twine upload dist/*')
92 self
.status('Pushing git tags…')
93 os
.system('git tag v{0}'.format(about
['__version__']))
94 os
.system('git push --tags')
99 # Where the magic happens:
102 version
=about
['__version__'],
103 description
=DESCRIPTION
,
104 long_description
=long_description
,
105 long_description_content_type
='text/markdown',
108 python_requires
=REQUIRES_PYTHON
,
110 packages
=find_packages('src'),
111 package_dir
={'': 'src'},
113 'console_scripts': ['mdgfm=markdowngfm.shell:main'],
114 }, # With console_scripts ActivePython can generate .exe file under Windows
116 install_requires
=REQUIRED
,
117 extras_require
=EXTRAS
,
118 include_package_data
=True,
122 #exclude_package_data={"": ["README.txt"]},
127 # Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
128 'License :: OSI Approved :: MIT License',
129 'Programming Language :: Python',
130 'Programming Language :: Python :: 3',
131 'Programming Language :: Python :: 3.6',
132 "Programming Language :: Python :: 3.7",
133 'Programming Language :: Python :: Implementation :: CPython',
134 'Programming Language :: Python :: Implementation :: PyPy'
136 # $ setup.py publish support.
138 'upload': UploadCommand
,