Skip to content

Commit

Permalink
Merge branch 'fix-pip-install-fail'
Browse files Browse the repository at this point in the history
  • Loading branch information
Falldog committed Feb 27, 2022
2 parents 3986878 + 0a05ebe commit 9570b5b
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ def finalize_options(self):
self.set_undefined_options('build', ('build_scripts', 'build_scripts'))

def _clean_build(self):
# for clear old build cached (majorly for *.o)
# but, `pip install pyconcrete` will build wheel first, then do installation, should skip the case avoid
# to clear current building files
for cmd, ran in self.distribution.have_run.items():
if cmd.startswith('build') and ran:
return

c = clean(self.distribution)
c.all = True
c.finalize_options()
Expand Down
1 change: 1 addition & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ idna>=2.5,<3; python_version < "3"
idna>=2.5,<4; python_version >= "3"
urllib3>=1.21.1,<1.27
certifi>=2017.4.17
wheel
# =====
31 changes: 31 additions & 0 deletions test/test_wheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python
#
# Copyright 2015 Falldog Hsieh <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import subprocess
from test import base

from src.config import PASSPHRASE_ENV


class TestWheel(base.TestPyConcreteBase):
def test_building_by_wheel(self):
env = os.environ.copy()
env[PASSPHRASE_ENV] = 'test'
sp = subprocess.run('pip wheel .', env=env, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if sp.returncode != 0:
print(sp.stdout.decode('utf-8'))
raise Exception("pip create wheel fail...")

0 comments on commit 9570b5b

Please sign in to comment.