-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit d825074
Showing
6 changed files
with
122 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,12 @@ | ||
name: Chisel3 Jar Package CI | ||
language: python | ||
script: | ||
- make prepare | ||
- python setup.py bdist_wheel | ||
deploy: | ||
provider: pypi | ||
username: $PYPI_NAME | ||
password: $PYPI_PW | ||
skip_cleanup: true | ||
on: | ||
tags: true |
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,5 @@ | ||
CACHE_TAR = https://github.com/colin4124/scratchip-binary/releases/download/v0.1/cache.tar.gz | ||
|
||
prepare: | ||
mkdir -p mill_cache/assets | ||
wget -O mill_cache/assets/cache.tar.gz $(CACHE_TAR) |
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,4 @@ | ||
try: | ||
from mill_bin.version import version as __version__ | ||
except ImportError: | ||
__version__ = "unknown" |
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,71 @@ | ||
# See LICENSE for license details. | ||
|
||
import argparse | ||
import os | ||
import sys | ||
import pkg_resources | ||
import shutil | ||
|
||
# Check if this is run from a local installation | ||
milldir = os.path.abspath( | ||
os.path.join(os.path.dirname(os.path.realpath(__file__)), "..") | ||
) | ||
if os.path.exists(os.path.join(milldir, "mill_cache")): | ||
sys.path[0:0] = [milldir] | ||
|
||
from mill_cache import __version__ | ||
|
||
def get_resource_name(name): | ||
return pkg_resources.resource_filename(__name__, name) | ||
|
||
def get_resource_string(name): | ||
return pkg_resources.resource_string(__name__, name) | ||
|
||
class MILLCache: | ||
def create(self, args): | ||
jars_path = args.dest_path | ||
if not os.path.exists(jars_path): | ||
os.mkdir(jars_path) | ||
|
||
shutil.copyfile(get_resource_name('assets/cache.tar.gz'), os.path.join(jars_path, 'cache.tar.gz')) | ||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser() | ||
|
||
# Global actions | ||
parser.add_argument( | ||
"--version", | ||
help="Show the Mill Cache version", | ||
action="version", | ||
version=__version__, | ||
) | ||
|
||
parser.add_argument( | ||
'dest_path', metavar="destination", type=str, nargs='?', | ||
default='.', help='Copy to the destination path') | ||
parser.set_defaults(func=create) | ||
|
||
args = parser.parse_args() | ||
|
||
if hasattr(args, "func"): | ||
return args | ||
if hasattr(args, "subparser"): | ||
args.subparser.print_help() | ||
else: | ||
parser.print_help() | ||
return None | ||
|
||
def create(args): | ||
sc = MILLCache() | ||
sc.create(args) | ||
|
||
def main(): | ||
args = parse_args() | ||
if not args: | ||
exit(0) | ||
|
||
# Run the function | ||
args.func(args) | ||
|
||
if __name__ == "__main__": | ||
main() |
Empty file.
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,30 @@ | ||
# coding:utf-8 | ||
|
||
from setuptools import setup | ||
|
||
setup( | ||
name="mill-cache", | ||
url='https://github.com/jlsemi', | ||
packages=["mill_cache"], | ||
package_data={ | ||
"mill_cache": [ | ||
"assets/cache.tar.gz", | ||
], | ||
}, | ||
use_scm_version={"relative_to": __file__, "write_to": "mill_cache/version.py",}, | ||
author="Leway Colin@JLSemi", | ||
author_email="[email protected]", | ||
description=( | ||
"Mill Cache is a tarball with all of mill's dependencies." | ||
), | ||
license="Apache-2.0 License", | ||
keywords=[ | ||
"mill cache files", | ||
], | ||
entry_points={"console_scripts": ["mill_cache = mill_cache.main:main"]}, | ||
setup_requires=["setuptools_scm",], | ||
install_requires=[ | ||
], | ||
# Supported Python versions: 3.6+ | ||
python_requires=">=3.6", | ||
) |