Skip to content

Commit

Permalink
test pip install setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Vasu Jaganath committed Aug 1, 2024
1 parent e9ae10a commit dc5a959
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# import argparse
from pathlib import Path
from shutil import copytree, ignore_patterns
from setuptools import setup, find_packages
from setuptools.command.install import install
import versioneer
# from sophios import _version, cli, input_output as io


class PostInstallCommand(install):
"""Post-installation for installation mode."""

# def run(self) -> None:
# install.run(self)
# # Custom post-installation actions go here
# args: argparse.Namespace = cli.get_args()
# if Path(args.config_file).exists():
# pass
# else:
# cwl_path = Path.home() / 'wic' / 'cwl_adapters'
# wic_path = Path.home() / 'wic' / 'examples'
# extlist = ['*.png', '*.md', '*.rst', '*.pyc', '__pycache__']
# adapters_dir = Path(__file__) / 'cwl_adapters'
# examples_dir = Path(__file__) / 'docs' / 'tutorials'
# copytree(adapters_dir, cwl_path)
# copytree(examples_dir, wic_path, ignore=ignore_patterns(*extlist))
# global_config = io.get_basic_config()
# # write the basic config object to the 'global_config.json' file in user's ~/wic directory
# # for user to inspect and or modify the config json file
# io.write_config_to_disk(global_config, Path(args.config_file))

def run(self) -> None:
install.run(self)
# Custom post-installation actions go here
if not (Path.home() / 'wic').exists():
cwl_path = Path.home() / 'wic' / 'cwl_adapters'
wic_path = Path.home() / 'wic' / 'examples'
extlist = ['*.png', '*.md', '*.rst', '*.pyc', '__pycache__', '*.json']
adapters_dir = Path(__file__).parent / 'cwl_adapters'
examples_dir = Path(__file__).parent / 'docs' / 'tutorials'
copytree(adapters_dir, cwl_path)
copytree(examples_dir, wic_path, ignore=ignore_patterns(*extlist))


setup(
name='sophios',
version=versioneer.get_version(),
packages=find_packages(),
cmdclass={
'install': PostInstallCommand,
},
)

0 comments on commit dc5a959

Please sign in to comment.