11"""
22PyGeM setup.py
33"""
4- import os
5- import sys
6- from setuptools import setup , find_packages , Command
7- import pygem
4+ from setuptools import setup , find_packages
85
96meta = {}
107with open ("pygem/meta.py" ) as fp :
2522
2623EXTRAS = {
2724 'docs' : ['Sphinx==1.4' , 'sphinx_rtd_theme' ],
25+ 'test' : ['pytest' , 'pytest-cov' ],
2826}
2927
3028LDESCRIPTION = (
3129 "PyGeM is a python package using Free Form Deformation, Radial Basis "
32- "Functions and Inverse Distance Weighting to parametrize and morph complex "
33- "geometries. It is ideally suited for actual industrial problems, since it "
34- "allows to handle:\n "
30+ "Functions and Inverse Distance Weighting to parametrize and morph "
31+ "complex geometries. It is ideally suited for actual industrial problems, "
32+ "since it allows to handle:\n "
3533 "1) Computer Aided Design files (in .iges, .step, and .stl formats) Mesh "
3634 "files (in .unv and OpenFOAM formats)\n "
3735 "2) Output files (in .vtk format)\n "
4240 "below and the Tutorials to have an idea of the potential of this package."
4341)
4442
45- here = os .path .abspath (os .path .dirname (__file__ ))
46- class UploadCommand (Command ):
47- """Support setup.py upload."""
48-
49- description = 'Build and publish the package.'
50- user_options = []
51-
52- @staticmethod
53- def status (s ):
54- """Prints things in bold."""
55- print ('\033 [1m{0}\033 [0m' .format (s ))
56-
57- def initialize_options (self ):
58- """ void """
59- pass
60-
61- def finalize_options (self ):
62- """ void """
63- pass
64-
65- def run (self ):
66- try :
67- self .status ('Removing previous builds...' )
68- rmtree (os .path .join (here , 'dist' ))
69- except OSError :
70- pass
71-
72- self .status ('Building Source and Wheel (universal) distribution...' )
73- os .system ('{0} setup.py sdist bdist_wheel --universal' .format (sys .executable ))
74-
75- self .status ('Uploading the package to PyPI via Twine...' )
76- os .system ('twine upload dist/*' )
77-
78- self .status ('Pushing git tags...' )
79- os .system ('git tag v{0}' .format (VERSION ))
80- os .system ('git push --tags' )
81-
82- sys .exit ()
8343
8444setup (
8545 name = NAME ,
@@ -102,12 +62,6 @@ def run(self):
10262 packages = find_packages (),
10363 install_requires = REQUIRED ,
10464 extras_require = EXTRAS ,
105- test_suite = 'nose.collector' ,
106- tests_require = ['nose' ],
10765 include_package_data = True ,
10866 zip_safe = False ,
109-
110- # $ setup.py publish support.
111- cmdclass = {
112- 'upload' : UploadCommand ,
113- },)
67+ )
0 commit comments