Skip to content

Commit 54ad472

Browse files
authored
Make Zulip an optional dependency (#86)
1 parent 27b7c14 commit 54ad472

File tree

8 files changed

+91
-84
lines changed

8 files changed

+91
-84
lines changed

.github/workflows/python.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@ jobs:
1717
python-version: ${{ matrix.python-version }}
1818
- name: Install dependencies
1919
run: |
20-
python -m pip install --upgrade pip
21-
pip install .
22-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
20+
python -m pip install --upgrade pip setuptools build[virtualenv]
21+
pip install .[tests]
2322
- name: Test with pytest
2423
run: |
2524
pytest
@@ -38,9 +37,8 @@ jobs:
3837
# https://github.com/python/mypy/issues/10600
3938
- name: Install dependencies
4039
run: |
41-
python -m pip install --upgrade pip
42-
pip install .
43-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
40+
python -m pip install --upgrade pip setuptools build[virtualenv]
41+
pip install .[zulip,tests]
4442
- name: Test with mypy
4543
run: |
4644
mypy src/running

MANIFEST.in

-1
This file was deleted.

README.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,19 @@
44
## Installation
55
`pip3 install running-ng`
66

7-
## Create a new release
7+
## Development setup
88
```console
9-
pip install --upgrade build
10-
python -m build
9+
virtualenv env
10+
source env/bin/activate
11+
pip install -U pip setuptools build[virtualenv]
1112
```
1213

14+
To make a distribution archives, run `python -m build` within the virtual environment.
15+
To run an editable build in the virtual environment, run `pip install -e .`.
16+
To install to user `site-packages`, run `pip install dist/running_ng-<VERSION>-py3-none-any.whl` outside the virtual environment.
17+
18+
To install extra
19+
1320
## Documentation
1421
Please refer to [this site](https://anupli.github.io/running-ng/) for up-to-date documentations.
1522

docs/src/changelog.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
# Changelog
22
## Unreleased
33
### Added
4+
5+
### Changed
6+
7+
### Deprecated
8+
9+
### Removed
10+
11+
### Fixed
12+
13+
### Security
14+
15+
## [`v0.3.1` (2022-09-18)](https://github.com/anupli/running-ng/releases/tag/v0.3.1)
16+
### Added
417
#### Base Syntax
518
- Use the `$RUNNING_NG_PACKAGE_DATA` environment variable to refer to base configurations shipped with running-ng, such as `$RUNNING_NG_PACKAGE_DATA/base/runbms.yml`, regardless how you installed runnin-ng.
619
#### Benchmark Suites
720
- `DaCapo` gains an extra key `companion` to facilitate eBPF tracing programs.
821

922
### Changed
10-
11-
### Deprecated
23+
- Overhauled Python packaging with PEP 517
24+
- `zulip` is now an optional Python dependency. Use `pip install running-ng[zulip]` if you want to use the `Zulip` `runbms` plugin.
1225

1326
### Removed
1427
- Dropping Python 3.6 support for users.
1528
#### Base Configurations
1629
- Removing AdoptOpenJDK from the base configuration files. AdoptOpenJDK is now replaced by Temurin.
1730

18-
### Fixed
19-
20-
### Security
21-
2231
## [`v0.3.0` (2022-03-19)](https://github.com/anupli/running-ng/releases/tag/v0.3.0)
2332
### Added
2433
#### Modifiers

pyproject.toml

+48-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,51 @@
11
[build-system]
22
requires = [
3-
"setuptools>=62.3.0"
3+
"setuptools>=62.3.0",
4+
"setuptools-scm"
45
]
5-
build-backend = "setuptools.build_meta"
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "running-ng"
10+
description = "Running: Next Generation"
11+
readme = "README.md"
12+
requires-python = ">=3.7"
13+
license = {text = "Apache"}
14+
classifiers = [
15+
'Development Status :: 3 - Alpha',
16+
'Intended Audience :: Science/Research',
17+
'License :: OSI Approved :: Apache Software License',
18+
'Topic :: System :: Benchmark',
19+
'Programming Language :: Python :: 3',
20+
]
21+
authors = [{name = "Zixian Cai", email = "u5937495@anu.edu.au"}]
22+
dependencies = [
23+
"pyyaml~=6.0"
24+
]
25+
dynamic = ["version"]
26+
27+
[project.urls]
28+
"Homepage" = "https://github.com/anupli/running-ng"
29+
"Bug Tracker" = "https://github.com/anupli/running-ng/issues"
30+
31+
[project.optional-dependencies]
32+
zulip = [
33+
"zulip~=0.8.2"
34+
]
35+
tests = [
36+
"pytest~=7.1.3",
37+
"types-PyYAML~=6.0.11",
38+
"mypy~=0.971"
39+
]
40+
41+
[project.scripts]
42+
running = "running.__main__:main"
43+
44+
[tool.setuptools.dynamic]
45+
version = {attr = "running.__version__.__VERSION__"}
46+
47+
[tool.setuptools.packages.find]
48+
where = ["src"]
49+
50+
[tool.setuptools.package-data]
51+
running = ["config/**/*.yml"]

requirements.txt

-6
This file was deleted.

setup.py

-59
This file was deleted.

src/running/plugin/runbms/__init__.py

+14-1
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,17 @@ def end_config(self, _hfac: Optional[float], _size: Optional[int], _bm: "Benchma
6060
# !!! Do NOT remove this import nor change its position
6161
# This is to make sure that the plugin classes are correctly registered
6262
from running.plugin.runbms.copyfile import CopyFile
63-
from running.plugin.runbms.zulip import Zulip
63+
if TYPE_CHECKING:
64+
from running.plugin.runbms.zulip import Zulip
65+
else:
66+
try:
67+
from running.plugin.runbms.zulip import Zulip
68+
except:
69+
from running.util import register
70+
@register(RunbmsPlugin)
71+
class Zulip(RunbmsPlugin):
72+
def __init__(self, **kwargs):
73+
raise RuntimeError("Trying to create an instance of the Zulip "
74+
"plugin for runbms, but the import failed. This is most likely due "
75+
"to the required dependencies not being installed. Try pip install "
76+
"running-ng[zulip] to install the extra dependencies.")

0 commit comments

Comments
 (0)