Skip to content

Commit

Permalink
Modernize the RACK cli packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
glguy committed Aug 21, 2023
1 parent 5589946 commit ba71902
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 48 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions cli/dev/README.md → cli/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_.
Expand Down
6 changes: 2 additions & 4 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,15 @@ 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.

```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
Expand Down
8 changes: 0 additions & 8 deletions cli/dev/requirements.txt

This file was deleted.

48 changes: 48 additions & 0 deletions cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion cli/bin/rack → cli/rack/rack_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

logger = logging.getLogger(__name__)

if __name__ == "__main__":
def main():
# Sets up colors for Windows users
colorama.init()

Expand Down
19 changes: 0 additions & 19 deletions cli/requirements.txt

This file was deleted.

7 changes: 0 additions & 7 deletions cli/setup.py

This file was deleted.

0 comments on commit ba71902

Please sign in to comment.