Skip to content

Commit

Permalink
fix: Run clean separately, due to package cache in Setuptools. Add pi…
Browse files Browse the repository at this point in the history
…p requirement for uberegg.
  • Loading branch information
jpmckinney committed Oct 11, 2024
1 parent 58debf1 commit 739c658
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ Added
Changed
^^^^^^^

- The ``scrapyd-deploy --debug`` option prints the subprocess' standard output and standard error, instead of writing to ``stdout`` and ``stderr`` files.
- The ``scrapyd-client schedule`` subcommand accepts multiple ``--arg setting=...`` arguments. (@mxdev88)
- The ``scrapyd_client.lib.schedule`` and ``scrapyd_client.ScrapyClient.schedule`` methods accept ``args`` as a list, instead of as a dict.
- The ``scrapyd-deploy --debug`` option prints the subprocess' standard output and standard error, instead of writing to ``stdout`` and ``stderr`` files.

Fixed
^^^^^

- The ``scrapyd-client schedule`` subcommand accepts multiple ``--arg setting=...`` arguments. (@mxdev88)
- Run ``clean`` separately from building the egg. (Setuptools caches the Python packages from before ``clean`` runs.)
- Add ``pip`` requirement for ``uberegg``.

Removed
^^^^^^^
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"pip", # uberegg
"requests",
"scrapy>=0.17",
"setuptools",
Expand All @@ -34,9 +35,9 @@ dependencies = [

[project.optional-dependencies]
test = [
"coverage",
"pytest",
"pytest-console-scripts",
"pytest-cov",
"pytest-mock",
]

Expand Down
3 changes: 2 additions & 1 deletion scrapyd_client/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def _build_egg(opts):
command = "bdist_egg"

kwargs = {} if opts.debug else {"stdout": subprocess.DEVNULL, "stderr": subprocess.DEVNULL}
subprocess.run([sys.executable, "setup.py", "clean", "-a", command, "-d", tmpdir], check=True, **kwargs)
subprocess.run([sys.executable, "setup.py", "clean", "-a"], check=True, **kwargs)
subprocess.run([sys.executable, "setup.py", command, "-d", tmpdir], check=True, **kwargs)

eggpath = glob.glob(os.path.join(tmpdir, "*.egg"))[0]
return eggpath, tmpdir
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scrapyd_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def test_build_egg_inc_dependencies_no_dep(script_runner, project):


def test_build_egg_inc_dependencies_with_dep(script_runner, project_with_dependencies):
ret = script_runner.run(["scrapyd-deploy", "--include-dependencies", "--build-egg", "myegg-deps.egg"])
ret = script_runner.run(["scrapyd-deploy", "--include-dependencies", "--build-egg", "myegg-deps.egg", "--debug"])

assert ret.stdout == ""
assert_lines(
Expand Down

0 comments on commit 739c658

Please sign in to comment.