summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2018-09-16 11:07:26 -0400
committerGitHub <noreply@github.com>2018-09-16 11:07:26 -0400
commitd00313856696b00710b8cf8052569d38c2536580 (patch)
tree0d31d33e2d531d127537ea121b63e34b65fa23a8
parentc5592a3c38f6d3ccfa81dcae9c457a150635d51c (diff)
parent47874756915a9a757f81d87f32ef5bfa2a333a26 (diff)
downloadpython-setuptools-git-d00313856696b00710b8cf8052569d38c2536580.tar.gz
Merge pull request #1427 from stephenfin/touch-egg-info-directory
Touch 'egg-info' directory
-rw-r--r--.gitignore1
-rw-r--r--changelog.d/1427.change.rst1
-rw-r--r--[-rwxr-xr-x]setuptools/command/easy_install.py0
-rw-r--r--setuptools/command/egg_info.py1
-rw-r--r--setuptools/tests/test_egg_info.py17
5 files changed, 20 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index b850622f..1f58eb31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ setuptools.egg-info
.coverage
.eggs
.tox
+.venv
*.egg
*.py[cod]
*.swp
diff --git a/changelog.d/1427.change.rst b/changelog.d/1427.change.rst
new file mode 100644
index 00000000..86260235
--- /dev/null
+++ b/changelog.d/1427.change.rst
@@ -0,0 +1 @@
+Set timestamp of ``.egg-info`` directory whenever ``egg_info`` command is run.
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index dd17cc13..dd17cc13 100755..100644
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index 74350cbd..bd116e1f 100644
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -281,6 +281,7 @@ class egg_info(InfoCommon, Command):
def run(self):
self.mkpath(self.egg_info)
+ os.utime(self.egg_info, None)
installer = self.distribution.fetch_build_egg
for ep in iter_entry_points('egg_info.writers'):
ep.require(installer=installer)
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 17d40fb8..59ffb16d 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -1,9 +1,11 @@
+import datetime
import sys
import ast
import os
import glob
import re
import stat
+import time
from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution
@@ -146,6 +148,21 @@ class TestEggInfo:
]
assert sorted(actual) == expected
+ def test_rebuilt(self, tmpdir_cwd, env):
+ """Ensure timestamps are updated when the command is re-run."""
+ self._create_project()
+
+ self._run_egg_info_command(tmpdir_cwd, env)
+ timestamp_a = os.path.getmtime('foo.egg-info')
+
+ # arbitrary sleep just to handle *really* fast systems
+ time.sleep(.001)
+
+ self._run_egg_info_command(tmpdir_cwd, env)
+ timestamp_b = os.path.getmtime('foo.egg-info')
+
+ assert timestamp_a != timestamp_b
+
def test_manifest_template_is_read(self, tmpdir_cwd, env):
self._create_project()
build_files({