Skip to content

Commit

Permalink
build: Modernize dependency management
Browse files Browse the repository at this point in the history
- Inline all requirements into `setup.py`
- Dissolve all `requirements/*` files
- Add Make target `install-develop` for installing the package in
  editable mode, for development purposes
  • Loading branch information
amotl committed Aug 25, 2023
1 parent 5972f19 commit 7106f79
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 321 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

- name: Setup project
run: |
pip install -r requirements/test.txt
make install-develop
- name: Run linter and software tests
run: |
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ help: ## Display this help message
@echo "Please use \`make <target>' where <target> is one of the following:"
@perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}'

install-develop: ## Install project into sandbox.
pip install --use-pep517 --prefer-binary --editable=.[develop,docs,test]

seed-isort-config: ## Update known third party dependencies
seed-isort-config --application-directories .:epo_ops --exclude setup.py

Expand Down
4 changes: 2 additions & 2 deletions docs/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ on behalf of a pull request, see the [contributing guidelines](contributing.md).
source .venv/bin/activate
```

3. Install required Python packages.
3. Install required Python packages into development sandbox.
```shell
pip install -r requirements/dev.txt
make install-develop
```


Expand Down
3 changes: 0 additions & 3 deletions requirements/base.in

This file was deleted.

9 changes: 0 additions & 9 deletions requirements/dev.in

This file was deleted.

195 changes: 0 additions & 195 deletions requirements/dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions requirements/test.in

This file was deleted.

106 changes: 0 additions & 106 deletions requirements/test.txt

This file was deleted.

28 changes: 26 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,30 @@

packages = ["epo_ops"]

requires = ["python-dateutil", "requests", "six"]
requires = [
"dogpile.cache<1.2",
"python-dateutil<2.9",
"requests>=2.27,<3",
"six<2",
]
extras = {
"develop": [
"black<24",
"bump2version<1.1",
"flake8<6",
"flake8-bugbear<22",
"isort<6",
"seed-isort-config<3",
"twine<5",
"wheel<1",
],
"test": [
"pytest<8",
"pytest-cache<2",
"pytest-cov<4.2",
"python-dotenv<0.20",
],
}

here = path.abspath(path.dirname(__file__))

Expand Down Expand Up @@ -45,7 +68,8 @@
package_dir={"epo_ops": "epo_ops"},
include_package_data=True,
install_requires=requires,
tests_require=["pytest", "pytest-cache", "pytest-cov"],
extras_require=extras,
tests_require=extras["test"],
zip_safe=False,
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down

0 comments on commit 7106f79

Please sign in to comment.