-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vasu Jaganath
committed
Aug 1, 2024
1 parent
e9ae10a
commit dc5a959
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}, | ||
) |