Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: remove requirement file #87

Merged
merged 10 commits into from
Jan 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install python dev dependencies.
run: |
python -m pip install -U pip --no-cache-dir
python -m pip install -e . -r requirements.txt
. script/bootstrap
- name: Lint
run: invoke lint
- name: Test
Expand Down
18 changes: 0 additions & 18 deletions requirements.in

This file was deleted.

13 changes: 6 additions & 7 deletions script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
if [[ -z $CI ]]; then
# pyenv update
pyenv install --skip-existing || return
VENV="${PWD##*/}.venv"
test -d $VENV || python3 -m venv $VENV || return
. $VENV/bin/activate
else
if [[ ! -f `pwd`/.python-version ]]; then
echo "You are missing a .python-version file."
Expand All @@ -17,10 +20,6 @@ else
fi
fi

VENV="${PWD##*/}.venv"
test -d $VENV || python3 -m venv $VENV || return
$VENV/bin/pip install -U pip --no-cache-dir
$VENV/bin/pip install -e . -r requirements.txt
$VENV/bin/python -m python_githooks

. $VENV/bin/activate
python -m pip install -U pip --no-cache-dir
python -m pip install -e . -r requirements.txt
python -m python_githooks
28 changes: 25 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@


python_requires = "~=3.6"
setup_requires = ["setuptools_scm"]
install_requires = ["typing_extensions>=3.6"]
dev_requires = [
"black",
"codecov",
"coverage[toml]",
"flake8",
"flake8-bugbear",
"flake8-builtins",
"flake8-comprehensions",
"flake8-i18n",
"invoke",
"isort",
"mypy",
"pip-tools",
"py-githooks",
"pytest",
"semver",
"twine",
"wheel",
]

if sys.version_info[0] == 2:
raise Exception("Only python 3 supported.")
Expand All @@ -18,7 +39,7 @@ def readme() -> str:
return f.read()


if __name__ == "__main__":
if __name__ in ["__main__", "builtins"]:
setup(
name="syrupy",
description="PyTest Snapshot Test Utility",
Expand All @@ -38,9 +59,10 @@ def readme() -> str:
package_dir={"": "src"},
packages=find_packages("./src"),
zip_safe=False,
install_requires=["typing_extensions"],
setup_requires=["setuptools_scm"],
entry_points={"pytest11": ["syrupy = syrupy"]},
extras_require={"dev": dev_requires},
install_requires=install_requires,
setup_requires=setup_requires,
python_requires=python_requires,
classifiers=[
"Development Status :: 1 - Planning",
Expand Down
8 changes: 6 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ def requirements(ctx, upgrade=False):
"""
Build dev requirements lock file
"""
source = "requirements.in"
dest = "requirements.txt"
args = ["--no-emit-find-links", "--no-index", "--allow-unsafe", "--rebuild"]
if upgrade:
args.append("--upgrade")
ctx.run(f"python -m piptools compile {source} {' '.join(args)}", pty=True)
ctx.run(
"echo '-e .[dev]' | python -m piptools compile "
f"{' '.join(args)} - -qo- | sed '/^-e / d' > {dest}",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workaround from jazzband/pip-tools#908

pty=True,
)


@task
Expand Down