diff --git a/.github/workflows/continuous.yml b/.github/workflows/continuous.yml index 9c176840..b7db2a24 100644 --- a/.github/workflows/continuous.yml +++ b/.github/workflows/continuous.yml @@ -29,13 +29,15 @@ jobs: # This path is specific to Ubuntu path: ~/.cache/pip # Look to see if there is a cache hit for the corresponding requirements file - key: ${{ runner.os }}-pip-${{ hashFiles('cli/dev/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('cli/pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- - name: Install RACK CLI development dependencies - run: pip3 install -q -r cli/dev/requirements.txt + run: | + cd cli + pip3 install "rack[dev]" - name: Lint RACK CLI run: | @@ -108,9 +110,9 @@ jobs: - name: Run rack-box tests run: | - cd RACK - pip3 install -r cli/requirements.txt - pip3 install cli/. + cd RACK/cli + pip3 install . + cd .. pip3 install -r tests/requirements.txt python3 -m pytest tests diff --git a/cli/dev/README.md b/cli/DEVELOPMENT.md similarity index 92% rename from cli/dev/README.md rename to cli/DEVELOPMENT.md index f65b39ba..cc77b84c 100644 --- a/cli/dev/README.md +++ b/cli/DEVELOPMENT.md @@ -15,8 +15,8 @@ are used to statically type-check the code. Usage is simple: ```shell source venv/bin/activate -pip install -r dev/requirements.txt -mypy . +pip install ".[dev]" +mypy rack ``` ## Tests @@ -25,8 +25,8 @@ You can run the tests with `pytest`: ```shell source venv/bin/activate -pip install -r dev/requirements.txt -python3 setup.py install && pytest +pip install ".[dev]" +pytest ``` Note that you should _always install the code before testing_. diff --git a/cli/README.md b/cli/README.md index 5dc26985..91244885 100644 --- a/cli/README.md +++ b/cli/README.md @@ -46,8 +46,7 @@ the RACK-Box README. ```shell python3 -m venv venv source venv/bin/activate -pip install --force -r requirements.txt -python3 setup.py install +pip install --force-reinstall . ``` If running on Windows, [GitBash](https://gitforwindows.org/) can be used with the following commands. @@ -55,8 +54,7 @@ If running on Windows, [GitBash](https://gitforwindows.org/) can be used with th ```shell python -m venv venv source venv/Scripts/activate -pip install --force -r requirements.txt -python setup.py install +pip install --force-reinstall . ``` ## Initialize RACK-in-a-Box diff --git a/cli/dev/requirements.txt b/cli/dev/requirements.txt deleted file mode 100644 index 209452b5..00000000 --- a/cli/dev/requirements.txt +++ /dev/null @@ -1,8 +0,0 @@ -mypy==1.0.0 -pylint==2.16.2 -pytest-docker==1.0.1 -pytest==7.2.1 -typed-ast==1.5.4 -types-PyYAML==6.0.12.6 -types-requests==2.28.11.13 -types-tabulate==0.9.0.0 diff --git a/cli/pyproject.toml b/cli/pyproject.toml new file mode 100644 index 00000000..d6a0c568 --- /dev/null +++ b/cli/pyproject.toml @@ -0,0 +1,48 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "rack" +version = "0.1" +description = "Command-line interface to RACK" +requires-python = ">=3.7" + +dependencies = [ + "ase==3.22.1", + "attrs==23.1.0", + "certifi==2023.7.22", + "chardet==5.1.0", + "colorama==0.4.6", + "idna==3.4", + "importlib-metadata==6.7.0", + "jsonschema==4.17.3", + "pyrsistent==0.19.3", + "python-dateutil==2.8.2", + "PyYAML==6.0", + "requests==2.31.0", + "Pillow==9.4.0", + "plotly==5.15.0", + "semtk-python3 @ git+https://github.com/ge-semtk/semtk-python3@7995623e12e93b9b252200b9bd507949b8c0a430", + "six==1.16.0", + "tabulate==0.9.0", + "urllib3==2.0.3", + "zipp==3.15.0", +] + +optional-dependencies.dev = [ + "mypy==1.0.0", + "pylint==2.16.2", + "pytest-docker==1.0.1", + "pytest==7.2.1", + "typed-ast==1.5.4", + "types-PyYAML==6.0.12.6", + "types-requests==2.28.11.13", + "types-tabulate==0.9.0.0", +] + +[tool.setuptools] +packages = ["rack"] + +[project.scripts] +rack = "rack.rack_cmd:main" diff --git a/cli/bin/rack b/cli/rack/rack_cmd.py similarity index 99% rename from cli/bin/rack rename to cli/rack/rack_cmd.py index ae8a0c65..2406d88d 100755 --- a/cli/bin/rack +++ b/cli/rack/rack_cmd.py @@ -31,7 +31,7 @@ logger = logging.getLogger(__name__) -if __name__ == "__main__": +def main(): # Sets up colors for Windows users colorama.init() diff --git a/cli/requirements.txt b/cli/requirements.txt deleted file mode 100644 index e3305931..00000000 --- a/cli/requirements.txt +++ /dev/null @@ -1,19 +0,0 @@ -ase==3.22.1 -attrs==23.1.0 -certifi==2023.7.22 -chardet==5.1.0 -colorama==0.4.6 -idna==3.4 -importlib-metadata==6.7.0 -jsonschema==4.17.3 -pyrsistent==0.19.3 -python-dateutil==2.8.2 -PyYAML==6.0 -requests==2.31.0 -Pillow==9.4.0 -plotly==5.15.0 -semtk-python3 @ git+https://github.com/ge-semtk/semtk-python3@7995623e12e93b9b252200b9bd507949b8c0a430 -six==1.16.0 -tabulate==0.9.0 -urllib3==2.0.3 -zipp==3.15.0 diff --git a/cli/setup.py b/cli/setup.py deleted file mode 100644 index d8e248d4..00000000 --- a/cli/setup.py +++ /dev/null @@ -1,7 +0,0 @@ -from setuptools import setup, find_packages - -setup( - name="rack", - scripts=["bin/rack"], - packages=find_packages(), -)