1 | from setuptools.command.sdist import sdist as SetuptoolsSdist |
||
0 ignored issues
–
show
|
|||
2 | from setuptools import setup, find_packages |
||
3 | import os |
||
0 ignored issues
–
show
|
|||
4 | import shutil |
||
0 ignored issues
–
show
|
|||
5 | |||
6 | import version |
||
7 | from src import PROJECT_NAME, PROJECT_DESCRIPTION |
||
8 | |||
9 | |||
10 | class SdistAndClean(SetuptoolsSdist): |
||
11 | ''' |
||
12 | Runs the default setuptools sdist command and then cleans the egg info |
||
13 | directory. |
||
14 | ''' |
||
15 | |||
16 | def run(self): |
||
17 | SetuptoolsSdist.run(self) |
||
18 | |||
19 | # FIXME This works, but there *has* to be a cleaner way |
||
20 | for distfile in self.filelist.files: |
||
21 | if distfile.endswith('PKG-INFO'): |
||
22 | egginfo_dir = os.path.dirname(distfile) |
||
23 | shutil.rmtree(egginfo_dir) |
||
24 | |||
25 | |||
26 | def package_names(): |
||
0 ignored issues
–
show
This function should have a docstring.
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods: class SomeClass:
def some_method(self):
"""Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions. ![]() |
|||
27 | return [PROJECT_NAME] + \ |
||
28 | [PROJECT_NAME + '.' + package for package in find_packages('src')] |
||
29 | |||
30 | setup( |
||
31 | cmdclass={ |
||
32 | 'sdist': SdistAndClean, |
||
33 | }, |
||
34 | name=PROJECT_NAME, |
||
35 | version=version.get_git_version(), |
||
36 | url='https://github.com/mattboyer/sqbrite', |
||
37 | description=PROJECT_DESCRIPTION, |
||
38 | author='Matt Boyer', |
||
39 | author_email='[email protected]', |
||
40 | license='BSD', |
||
41 | classifiers=[ |
||
42 | 'Development Status :: 2 - Pre-Alpha', |
||
43 | ], |
||
44 | packages=package_names(), |
||
45 | # Packaging data files in Python is a complete shitshow |
||
46 | # We need this *AND* an "include" line in MANIFEST.IN |
||
47 | include_package_data=True, |
||
48 | package_dir={PROJECT_NAME: 'src'}, |
||
49 | install_requires=[ |
||
50 | 'pyxdg', |
||
51 | ], |
||
52 | entry_points={ |
||
53 | 'console_scripts': [ |
||
54 | PROJECT_NAME+'='+PROJECT_NAME+'.sqlite_recover:main', |
||
55 | ], |
||
56 | }, |
||
57 | ) |
||
58 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.