generated from akashdhruv/myproject
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
c7d2ea3
commit 20ac8ac
Showing
15 changed files
with
220 additions
and
41 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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
include README.rst | ||
include NOTICE | ||
include LICENSE | ||
include bin/* | ||
include requirements/* | ||
include media/* |
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
"""Custom commands for BoxKit setup.""" | ||
import os | ||
import sys | ||
import subprocess | ||
from setuptools.command.install import install | ||
from setuptools.command.develop import develop | ||
|
||
# custom command | ||
class CustomCmd: | ||
"""Custom command.""" | ||
|
||
user_options = [ | ||
("with-instruments", None, "Install additional modules for instruments"), | ||
] | ||
|
||
def initialize_options(self): | ||
""" | ||
Initialize options | ||
""" | ||
self.with_instruments = None # pylint: disable=attribute-defined-outside-init | ||
|
||
def finalize_options(self): | ||
""" | ||
Finalize options | ||
""" | ||
for option in [ | ||
"with_instruments", | ||
]: | ||
if getattr(self, option) not in [None, 1]: | ||
raise ValueError(f"{option} is a flag") | ||
|
||
def run(self, user): | ||
""" | ||
Run command | ||
""" | ||
if user: | ||
with_user = "--user" | ||
else: | ||
with_user = "" | ||
|
||
if self.with_instruments: | ||
subprocess.run( | ||
f"{sys.executable} -m pip install -r requirements/instruments.txt {with_user}", | ||
shell=True, | ||
check=True, | ||
executable="/bin/bash", | ||
) | ||
|
||
with open("jobrunner/options.py", "w", encoding="ascii") as optfile: | ||
|
||
optfile.write(f"INSTRUMENTS={self.with_instruments}\n") | ||
|
||
|
||
# replaces the default build command for setup.py | ||
class InstallCmd(install, CustomCmd): | ||
"""Custom build command.""" | ||
|
||
user_options = install.user_options + CustomCmd.user_options | ||
|
||
def initialize_options(self): | ||
install.initialize_options(self) | ||
CustomCmd.initialize_options(self) | ||
|
||
def finalize_options(self): | ||
install.finalize_options(self) | ||
CustomCmd.finalize_options(self) | ||
|
||
def run(self): | ||
|
||
CustomCmd.run(self, self.user) | ||
install.run(self) | ||
|
||
|
||
# replaces custom develop command for setup.py | ||
class DevelopCmd(develop, CustomCmd): | ||
"""Custom develop command.""" | ||
|
||
user_options = develop.user_options + CustomCmd.user_options | ||
|
||
def initialize_options(self): | ||
develop.initialize_options(self) | ||
CustomCmd.initialize_options(self) | ||
|
||
def finalize_options(self): | ||
develop.finalize_options(self) | ||
CustomCmd.finalize_options(self) | ||
|
||
def run(self): | ||
|
||
develop.run(self) | ||
CustomCmd.run(self, self.user) |
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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
"""Initialization method for PyJobrunner""" | ||
|
||
from . import options | ||
|
||
if options.INSTRUMENTS == 1: | ||
from . import instruments | ||
|
||
from . import lib | ||
from . import resources | ||
from . import api | ||
from . import cli |
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
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
click | ||
toml | ||
pyyaml | ||
alive-progress==3.1.4 |
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,3 @@ | ||
numpy | ||
h5py | ||
scipy==1.8.0 |
Oops, something went wrong.