MetaData Sharing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

83 lines
2.3 KiB

  1. # python setup.py --dry-run --verbose install
  2. import os.path
  3. import pathlib
  4. import shutil
  5. import subprocess
  6. from setuptools import setup, find_packages, Command, Extension
  7. from setuptools.command.build_ext import build_ext
  8. #from medashare.magic_wrap import compile_file
  9. class file_ext(build_ext):
  10. def __init__(self, dist):
  11. super().__init__(dist)
  12. def run(self):
  13. # do the building
  14. #print(repr(self.distribution))
  15. fnames = [ (x, pathlib.Path(self.build_lib) / 'medashare' / x) for x in self.get_source_files() ]
  16. oldcwd = os.getcwd()
  17. for src, dst in fnames:
  18. os.chdir(oldcwd)
  19. shutil.copyfile(src, dst)
  20. os.chdir(dst.parent)
  21. cmd = [ 'file', '-C', '-m' ] + [ str(dst) for src, dst in fnames ]
  22. #print('running:', cmd)
  23. r = subprocess.run(cmd)
  24. os.chdir(oldcwd)
  25. r.check_returncode()
  26. def get_outputs(self):
  27. return [ '%s.mgc' % i for i in self.get_source_files() ]
  28. # method build_extension not needed, in run
  29. setup(
  30. name='medashare',
  31. version='0.1.1',
  32. author='John-Mark Gurney',
  33. author_email='jmg@funkthat.com',
  34. packages=find_packages(),
  35. #url='',
  36. license='BSD',
  37. description='File Metadata sharing, query and storing utility.',
  38. #download_url='',
  39. long_description=open('README.md').read(),
  40. python_requires='>=3.8',
  41. # This isn't needed till magic_wrap.py can use it
  42. #cmdclass=dict(build_ext=file_ext),
  43. #ext_modules=[ Extension(name='magic', sources=['medashare/magic']) ],
  44. install_requires=[
  45. 'alembic',
  46. 'base58',
  47. 'edgold @ git+https://www.funkthat.com/gitea/jmg/ed448goldilocks.git@pyupdate#egg=edgold&subdirectory=python',
  48. 'databases[sqlite]',
  49. 'fastapi',
  50. 'fastapi_restful',
  51. 'httpx',
  52. 'SQLAlchemy',
  53. 'hypercorn', # option, for server only?
  54. 'orm',
  55. 'pasn1 @ git+https://www.funkthat.com/gitea/jmg/pasn1.git@c6c64510b42292557ace2b77272eb32cb647399d#egg=pasn1',
  56. 'python-libarchive @ git+https://www.funkthat.com/gitea/jmg/python-libarchive.git#egg=python-libarchive',
  57. 'pydantic[dotenv]',
  58. ],
  59. include_package_data=True,
  60. package_data={
  61. 'medashare': [ 'alembic/**/*.py', 'alembic.ini', ],
  62. },
  63. extras_require = {
  64. # requests needed for fastpi.testclient.TestClient
  65. 'dev': [ 'coverage', 'requests' ],
  66. },
  67. entry_points={
  68. 'console_scripts': [
  69. 'medashare = medashare.cli:main',
  70. ]
  71. }
  72. )