mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-23 23:30:54 +00:00
switched to single quotes everywhere
This commit is contained in:
InvenTree
InvenTree
admin.pyapi.pyapps.pyci_render_js.pyconfig.pyconversion.pyemail.pyexceptions.pyexchange.pyfilters.pyformat.pyforms.pyhelpers.pyhelpers_model.pymagic_login.py
management
metadata.pymiddleware.pymodels.pypermissions.pyready.pysentry.pyserializers.pysettings.pysocial_auth_urls.pysso.pystatus.pystatus_codes.pytasks.pytest_api.pytest_urls.pytest_views.pytests.pyunit_test.pyurls.pyvalidators.pyversion.pyviews.pywsgi.pycommon
company
generic
gunicorn.conf.pylabel
manage.pyorder
api.pymodels.pyserializers.pytasks.pytest_api.pytest_migrations.pytest_sales_order.pytests.pyviews.py
part
api.pyapps.pybom.pyhelpers.pymodels.pyserializers.pystocktake.pytasks.py
templatetags
test_api.pytest_bom_import.pytest_bom_item.pytest_category.pytest_migrations.pytest_param.pytest_part.pytest_pricing.pyviews.pyplugin
admin.pyapi.pyapps.pyhelpers.pyinstaller.pyserializers.pytest_plugin.py
base
action
barcodes
integration
label
locate
builtin
barcodes
integration
labels
suppliers
mock
models.pyplugin.pyregistry.pysamples
event
integration
another_sample.pyapi_caller.pycustom_panel_sample.pylabel_sample.pyreport_plugin_sample.pysample.pysample_currency_exchange.pyscheduled_task.pysimpleactionplugin.pytest_sample.pytest_scheduled_task.pytest_simpleactionplugin.pytransition.pyvalidation_sample.pyversion.py
locate
report
script
stock
users
web
ci
check_api_endpoint.pycheck_js_templates.pycheck_locale_files.pycheck_migration_files.pyversion_check.py
docker
docs/docs
pyproject.tomltasks.py@ -26,7 +26,7 @@ def get_existing_release_tags():
|
||||
headers = None
|
||||
|
||||
if token:
|
||||
headers = {"Authorization": f"Bearer {token}"}
|
||||
headers = {'Authorization': f'Bearer {token}'}
|
||||
|
||||
response = requests.get(
|
||||
'https://api.github.com/repos/inventree/inventree/releases', headers=headers
|
||||
@ -44,7 +44,7 @@ def get_existing_release_tags():
|
||||
|
||||
for release in data:
|
||||
tag = release['tag_name'].strip()
|
||||
match = re.match(r"^.*(\d+)\.(\d+)\.(\d+).*$", tag)
|
||||
match = re.match(r'^.*(\d+)\.(\d+)\.(\d+).*$', tag)
|
||||
|
||||
if len(match.groups()) != 3:
|
||||
print(f"Version '{tag}' did not match expected pattern")
|
||||
@ -64,7 +64,7 @@ def check_version_number(version_string, allow_duplicate=False):
|
||||
print(f"Checking version '{version_string}'")
|
||||
|
||||
# Check that the version string matches the required format
|
||||
match = re.match(r"^(\d+)\.(\d+)\.(\d+)(?: dev)?$", version_string)
|
||||
match = re.match(r'^(\d+)\.(\d+)\.(\d+)(?: dev)?$', version_string)
|
||||
|
||||
if not match or len(match.groups()) != 3:
|
||||
raise ValueError(
|
||||
@ -85,7 +85,7 @@ def check_version_number(version_string, allow_duplicate=False):
|
||||
|
||||
if release > version_tuple:
|
||||
highest_release = False
|
||||
print(f"Found newer release: {str(release)}")
|
||||
print(f'Found newer release: {str(release)}')
|
||||
|
||||
return highest_release
|
||||
|
||||
@ -104,10 +104,10 @@ if __name__ == '__main__':
|
||||
GITHUB_BASE_REF = os.environ['GITHUB_BASE_REF']
|
||||
|
||||
# Print out version information, makes debugging actions *much* easier!
|
||||
print(f"GITHUB_REF: {GITHUB_REF}")
|
||||
print(f"GITHUB_REF_NAME: {GITHUB_REF_NAME}")
|
||||
print(f"GITHUB_REF_TYPE: {GITHUB_REF_TYPE}")
|
||||
print(f"GITHUB_BASE_REF: {GITHUB_BASE_REF}")
|
||||
print(f'GITHUB_REF: {GITHUB_REF}')
|
||||
print(f'GITHUB_REF_NAME: {GITHUB_REF_NAME}')
|
||||
print(f'GITHUB_REF_TYPE: {GITHUB_REF_TYPE}')
|
||||
print(f'GITHUB_BASE_REF: {GITHUB_BASE_REF}')
|
||||
|
||||
version_file = os.path.join(here, '..', 'InvenTree', 'InvenTree', 'version.py')
|
||||
|
||||
@ -120,7 +120,7 @@ if __name__ == '__main__':
|
||||
results = re.findall(r'INVENTREE_SW_VERSION = "(.*)"', text)
|
||||
|
||||
if len(results) != 1:
|
||||
print(f"Could not find INVENTREE_SW_VERSION in {version_file}")
|
||||
print(f'Could not find INVENTREE_SW_VERSION in {version_file}')
|
||||
sys.exit(1)
|
||||
|
||||
version = results[0]
|
||||
@ -164,15 +164,15 @@ if __name__ == '__main__':
|
||||
docker_tags = ['latest']
|
||||
|
||||
else:
|
||||
print("Unsupported branch / version combination:")
|
||||
print(f"InvenTree Version: {version}")
|
||||
print("GITHUB_REF_TYPE:", GITHUB_REF_TYPE)
|
||||
print("GITHUB_BASE_REF:", GITHUB_BASE_REF)
|
||||
print("GITHUB_REF:", GITHUB_REF)
|
||||
print('Unsupported branch / version combination:')
|
||||
print(f'InvenTree Version: {version}')
|
||||
print('GITHUB_REF_TYPE:', GITHUB_REF_TYPE)
|
||||
print('GITHUB_BASE_REF:', GITHUB_BASE_REF)
|
||||
print('GITHUB_REF:', GITHUB_REF)
|
||||
sys.exit(1)
|
||||
|
||||
if docker_tags is None:
|
||||
print("Docker tags could not be determined")
|
||||
print('Docker tags could not be determined')
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Version check passed for '{version}'!")
|
||||
@ -181,9 +181,9 @@ if __name__ == '__main__':
|
||||
# Ref: https://getridbug.com/python/how-to-set-environment-variables-in-github-actions-using-python/
|
||||
with open(os.getenv('GITHUB_ENV'), 'a') as env_file:
|
||||
# Construct tag string
|
||||
tags = ",".join([f"inventree/inventree:{tag}" for tag in docker_tags])
|
||||
tags = ','.join([f'inventree/inventree:{tag}' for tag in docker_tags])
|
||||
|
||||
env_file.write(f"docker_tags={tags}\n")
|
||||
env_file.write(f'docker_tags={tags}\n')
|
||||
|
||||
if GITHUB_REF_TYPE == 'tag' and highest_release:
|
||||
env_file.write("stable_release=true\n")
|
||||
env_file.write('stable_release=true\n')
|
||||
|
Reference in New Issue
Block a user