Commit d0031385 authored by Jason R. Coombs's avatar Jason R. Coombs Committed by GitHub

Merge pull request #1427 from stephenfin/touch-egg-info-directory

Touch 'egg-info' directory
parents c5592a3c 47874756
...@@ -10,6 +10,7 @@ setuptools.egg-info ...@@ -10,6 +10,7 @@ setuptools.egg-info
.coverage .coverage
.eggs .eggs
.tox .tox
.venv
*.egg *.egg
*.py[cod] *.py[cod]
*.swp *.swp
......
Set timestamp of ``.egg-info`` directory whenever ``egg_info`` command is run.
File mode changed from 100755 to 100644
...@@ -281,6 +281,7 @@ class egg_info(InfoCommon, Command): ...@@ -281,6 +281,7 @@ class egg_info(InfoCommon, Command):
def run(self): def run(self):
self.mkpath(self.egg_info) self.mkpath(self.egg_info)
os.utime(self.egg_info, None)
installer = self.distribution.fetch_build_egg installer = self.distribution.fetch_build_egg
for ep in iter_entry_points('egg_info.writers'): for ep in iter_entry_points('egg_info.writers'):
ep.require(installer=installer) ep.require(installer=installer)
......
import datetime
import sys import sys
import ast import ast
import os import os
import glob import glob
import re import re
import stat import stat
import time
from setuptools.command.egg_info import egg_info, manifest_maker from setuptools.command.egg_info import egg_info, manifest_maker
from setuptools.dist import Distribution from setuptools.dist import Distribution
...@@ -146,6 +148,21 @@ class TestEggInfo: ...@@ -146,6 +148,21 @@ class TestEggInfo:
] ]
assert sorted(actual) == expected 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): def test_manifest_template_is_read(self, tmpdir_cwd, env):
self._create_project() self._create_project()
build_files({ build_files({
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment