refresh-requirements.sh: Add support for comptible release packages
Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>merge-requests/364/head
parent
adf4b813a8
commit
efa30be189
|
@ -17,7 +17,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
EXCLUDE_REGEXP="^\\(pkg-resources\\|satnogs-db\\|satnogsdecoders\\)"
|
||||
EXCLUDE_REGEXP="^\\(pkg-resources\\|satnogs-db\\)"
|
||||
COMPATIBLE_REGEXP="^\\(satnogsdecoders\\)"
|
||||
VIRTUALENV_DIR=$(mktemp -d)
|
||||
PIP_COMMAND="$VIRTUALENV_DIR/bin/pip"
|
||||
|
||||
|
@ -34,10 +35,14 @@ cat << EOF > requirements.txt
|
|||
# Please edit 'setup.cfg' to add top-level dependencies and use
|
||||
# './contrib/refresh-requirements.sh to regenerate this file
|
||||
|
||||
satnogsdecoders~=0.0
|
||||
EOF
|
||||
"$PIP_COMMAND" freeze | grep -v "$EXCLUDE_REGEXP" >> requirements.txt
|
||||
|
||||
# Set compatible release packages in requirements file
|
||||
if [ -n "$COMPATIBLE_REGEXP" ]; then
|
||||
sed -i 's/'"$COMPATIBLE_REGEXP"'==\([0-9]\+\)\(\.[0-9]\+\)\+$/\1~=\2.0/' requirements.txt
|
||||
fi
|
||||
|
||||
# Install development package with dependencies
|
||||
"$PIP_COMMAND" install --no-cache-dir .[dev]
|
||||
|
||||
|
@ -56,6 +61,11 @@ _tmp_requirements_dev=$(mktemp)
|
|||
sort < requirements.txt | comm -13 - "$_tmp_requirements_dev" >> requirements-dev.txt
|
||||
rm -f "$_tmp_requirements_dev"
|
||||
|
||||
# Set compatible release packages in development requirements file
|
||||
if [ -n "$COMPATIBLE_REGEXP" ]; then
|
||||
sed -i 's/'"$COMPATIBLE_REGEXP"'==\([0-9]\+\)\(\.[0-9]\+\)\+$/\1~=\2.0/' requirements-dev.txt
|
||||
fi
|
||||
|
||||
# Verify dependency compatibility
|
||||
"$PIP_COMMAND" check
|
||||
|
||||
|
|
Loading…
Reference in New Issue