-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create setting dir and file after installing this package
- Loading branch information
1 parent
24e2089
commit 30d6926
Showing
5 changed files
with
32 additions
and
9 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
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
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ rich | |
boto3~=1.28.64 | ||
minio | ||
s3fs~=2023.10 | ||
appdirs |
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 |
---|---|---|
|
@@ -22,3 +22,4 @@ rich | |
boto3==1.28.64 | ||
minio | ||
s3fs==2023.10 | ||
appdirs |
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 |
---|---|---|
|
@@ -2,18 +2,20 @@ | |
""" | ||
Author: Wenyu Ouyang | ||
Date: 2022-12-02 10:42:19 | ||
LastEditTime: 2023-07-31 17:11:11 | ||
LastEditTime: 2024-02-14 12:12:06 | ||
LastEditors: Wenyu Ouyang | ||
Description: The setup script. | ||
FilePath: /hydroutils/setup.py | ||
FilePath: \hydroutils\setup.py | ||
Copyright (c) 2023-2024 Wenyu Ouyang. All rights reserved. | ||
""" | ||
|
||
|
||
import io | ||
import pathlib | ||
import appdirs | ||
from os import path as op | ||
from setuptools import setup, find_packages | ||
from setuptools.command.install import install | ||
|
||
readme = pathlib.Path("README.md").read_text() | ||
here = op.abspath(op.dirname(__file__)) | ||
|
@@ -35,18 +37,30 @@ | |
"pytest>=3", | ||
] | ||
|
||
|
||
class PostInstallCommand(install): | ||
def run(self): | ||
install.run(self) | ||
# Define cache and config paths | ||
setting_dir = pathlib.Path.home() | ||
cache_dir = appdirs.user_cache_dir(".hydro") | ||
if not cache_dir.is_dir(): | ||
cache_dir.mkdir(parents=True) | ||
setting_file = setting_dir.joinpath("hydro_setting.yml") | ||
if not setting_file.is_file(): | ||
setting_file.touch(exist_ok=False) | ||
|
||
|
||
setup( | ||
author="Wenyu Ouyang", | ||
author_email="[email protected]", | ||
python_requires=">=3.7", | ||
python_requires=">=3.9", | ||
classifiers=[ | ||
"Development Status :: 2 - Pre-Alpha", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
], | ||
|
@@ -69,6 +83,9 @@ | |
test_suite="tests", | ||
tests_require=test_requirements, | ||
url="https://github.com/OuyangWenyu/hydroutils", | ||
version='0.0.7', | ||
version="0.0.7", | ||
zip_safe=False, | ||
cmdclass={ | ||
"install": PostInstallCommand, | ||
}, | ||
) |