Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[MRG] ENH Add a commit flag [ci recythonize] to recythonize all the sources. #7708

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

Closed
Closed
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
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ sudo: false

language: python

before_install:
# Let's use this to pass messages to our build system
# [ci recythonize] will force recythonizing of all cython files
- "export TRAVIS_COMMIT_MSG=\"$(git log --format=%B --no-merges -n 1)\""

# Pre-install packages for the ubuntu distribution
cache:
apt: true
Expand Down
8 changes: 7 additions & 1 deletion build_tools/cythonize.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,13 @@ def cythonize_if_unchanged(path, cython_file, gen_file, hashes):

def check_and_cythonize(root_dir):
print(root_dir)
hashes = load_hashes(HASH_FILE)
if "[ci recythonize]" in os.environ.get("TRAVIS_COMMIT_MSG", "").lower():
# Force recythonizing of all the cython files.
print("Commit flag '[ci recythonize]' detected. Forcing a recythonize"
" of all the cython sources.")
hashes = {}
else:
hashes = load_hashes(HASH_FILE)

for cur_dir, dirs, files in os.walk(root_dir):
for filename in files:
Expand Down