Skip to content

Commit

Permalink
Rework dependencies specification by using setup.py extras
Browse files Browse the repository at this point in the history
test_requires and `python setup.py test` are deprecated. The new way
is to specify extra dependencies for the package through
`extra_requires`.
  • Loading branch information
Julien Rebetez authored and julienr committed Feb 7, 2024
1 parent db5e2e8 commit 91da08a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -24,12 +23,13 @@ jobs:
run: |
python -m pip install --upgrade pip setuptools wheel flake8 twine
python setup.py develop
pip install -e .[test,lint]
- name: lint
run: |
python -m flake8
- name: tests
run: |
python setup.py test
pytest -v tests
# Test the build and run twine to check we are pypi compatible
- name: check build
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx
sphinx==7.2.6
sphinx-rtd-theme
sphinx-autobuild
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()

lint_deps = ["flake8"]
test_deps = ["pytest==7.1", "responses==0.22", "httpretty"]

setup(
name="picterra",
version="1.2.2",
Expand All @@ -15,14 +18,13 @@
long_description_content_type="text/markdown",
package_dir={"": "src"},
packages=find_packages("src"),
setup_requires=[
"pytest-runner",
"flake8",
],
install_requires=[
"requests",
# We use the new `allowed_methods` option
"urllib3>=1.26.0",
],
tests_require=["pytest==7.1", "flake8", "responses==0.22", "httpretty"],
extras_require={
'test': test_deps,
'lint': lint_deps,
}
)

0 comments on commit 91da08a

Please sign in to comment.