Skip to content

Commit 65281b4

Browse files
authored
Merge pull request #2902 from deniszh/ubuntu-fix
pinning ubuntu version
2 parents ce4e991 + 156559e commit 65281b4

File tree

4 files changed

+129
-115
lines changed

4 files changed

+129
-115
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,55 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ master, 0.9.x, 1.0.x, 1.1.x ]
5+
branches: [master, 0.9.x, 1.0.x, 1.1.x]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: [ master ]
8+
branches: [master]
99
schedule:
10-
- cron: '45 9 * * 0'
10+
- cron: "45 9 * * 0"
1111

1212
jobs:
1313
analyze:
1414
name: Analyze
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-22.04
1616

1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
language: [ 'javascript', 'python' ]
20+
language: ["javascript", "python"]
2121
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
2222
# Learn more:
2323
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
2424

2525
steps:
26-
- name: Checkout repository
27-
uses: actions/checkout@v4
28-
29-
# Initializes the CodeQL tools for scanning.
30-
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v3
32-
with:
33-
languages: ${{ matrix.language }}
34-
# If you wish to specify custom queries, you can do so here or in a config file.
35-
# By default, queries listed here will override any specified in a config file.
36-
# Prefix the list here with "+" to use these queries and those in the config file.
37-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
38-
39-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
40-
# If this step fails, then you should remove it and run the build manually (see below)
41-
- name: Autobuild
42-
uses: github/codeql-action/autobuild@v3
43-
44-
# ℹ️ Command-line programs to run using the OS shell.
45-
# 📚 https://git.io/JvXDl
46-
47-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
48-
# and modify them (or add more) to build your code if your project
49-
# uses a compiled language
50-
51-
#- run: |
52-
# make bootstrap
53-
# make release
54-
55-
- name: Perform CodeQL Analysis
56-
uses: github/codeql-action/analyze@v3
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
# Initializes the CodeQL tools for scanning.
30+
- name: Initialize CodeQL
31+
uses: github/codeql-action/init@v3
32+
with:
33+
languages: ${{ matrix.language }}
34+
# If you wish to specify custom queries, you can do so here or in a config file.
35+
# By default, queries listed here will override any specified in a config file.
36+
# Prefix the list here with "+" to use these queries and those in the config file.
37+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
38+
39+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
40+
# If this step fails, then you should remove it and run the build manually (see below)
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@v3
43+
44+
# ℹ️ Command-line programs to run using the OS shell.
45+
# 📚 https://git.io/JvXDl
46+
47+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
48+
# and modify them (or add more) to build your code if your project
49+
# uses a compiled language
50+
51+
#- run: |
52+
# make bootstrap
53+
# make release
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v3

.github/workflows/tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: Run tests
22

33
on:
44
push:
5-
branches: [ master, 1.0.x, 1.1.x ]
5+
branches: [master, 1.0.x, 1.1.x]
66
pull_request:
77
# The branches below must be a subset of the branches above
8-
branches: [ master, 1.0.x, 1.1.x ]
8+
branches: [master, 1.0.x, 1.1.x]
99
workflow_dispatch:
1010

1111
jobs:
1212
build:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-22.04
1414

1515
services:
1616
redis:
@@ -38,13 +38,13 @@ jobs:
3838

3939
strategy:
4040
matrix:
41-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
41+
python-version: ["3.10", "3.11", "3.12", "3.13"]
4242

4343
steps:
4444
- uses: actions/checkout@v4
4545
- name: Install global dependencies
4646
run: |
47-
sudo apt-get -y install libcairo2-dev librrd-dev libboost-python-dev redis-tools
47+
sudo apt-get -y install libcairo2-dev librrd-dev libboost-python-dev redis-tools python3-distutils-extra
4848
- name: Verify Redis connection
4949
env:
5050
REDIS_PORT: ${{ job.services.redis.ports[6379] }}
@@ -66,7 +66,7 @@ jobs:
6666
python-version: ${{ matrix.python-version }}
6767
- name: Install dependencies
6868
run: |
69-
python -m pip install --upgrade pip 'setuptools<58' --force-reinstall
69+
python -m pip install --upgrade pip 'setuptools>=67.0.0' wheel --force-reinstall
7070
pip install 'tox<4' tox-gh-actions flake8 pytest pytz
7171
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
7272
- name: Test with tox
@@ -102,4 +102,4 @@ jobs:
102102
codecov
103103
- name: Upload coverage to Codecov
104104
if: ${{ matrix.python-version==3.13 }}
105-
uses: codecov/codecov-action@v5
105+
uses: codecov/codecov-action@v5

setup.py

Lines changed: 85 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,56 @@
1818
# required for installations from a source tarball because running
1919
# ``python setup.py sdist`` will re-add the prefix to the tarball's
2020
# ``setup.cfg``.
21-
with open('setup.cfg', 'r') as f:
21+
with open("setup.cfg", "r") as f:
2222
orig_setup_cfg = f.read()
2323
cf = ConfigParser()
24-
cf.read_file(StringIO(orig_setup_cfg), 'setup.cfg')
24+
cf.read_file(StringIO(orig_setup_cfg), "setup.cfg")
2525

26-
if os.environ.get('GRAPHITE_NO_PREFIX') or os.environ.get('READTHEDOCS'):
27-
cf.remove_section('install')
26+
if os.environ.get("GRAPHITE_NO_PREFIX") or os.environ.get("READTHEDOCS"):
27+
cf.remove_section("install")
2828
else:
2929
try:
30-
cf.add_section('install')
30+
cf.add_section("install")
3131
except DuplicateSectionError:
3232
pass
33-
if not cf.has_option('install', 'prefix'):
34-
cf.set('install', 'prefix', '/opt/graphite')
35-
if not cf.has_option('install', 'install-lib'):
36-
cf.set('install', 'install_lib', '%(prefix)s/webapp')
33+
if not cf.has_option("install", "prefix"):
34+
cf.set("install", "prefix", "/opt/graphite")
35+
if not cf.has_option("install", "install-lib"):
36+
cf.set("install", "install_lib", "%(prefix)s/webapp")
3737

38-
with open('setup.cfg', 'w') as f:
38+
with open("setup.cfg", "w") as f:
3939
cf.write(f)
4040

41-
if os.environ.get('USE_DISTUTILS'):
41+
if os.environ.get("USE_DISTUTILS"):
4242
# skipcq: PYL-W0402
4343
from distutils.core import setup
44+
4445
setup_kwargs = dict()
4546
else:
4647
from setuptools import setup
48+
4749
setup_kwargs = dict(zip_safe=0)
4850

4951
storage_dirs = []
5052

51-
for subdir in ('whisper/dummy.txt', 'ceres/dummy.txt', 'rrd/dummy.txt', 'log/dummy.txt', 'log/webapp/dummy.txt'):
52-
storage_dirs.append( ('storage/%s' % subdir, []) )
53+
for subdir in (
54+
"whisper/dummy.txt",
55+
"ceres/dummy.txt",
56+
"rrd/dummy.txt",
57+
"log/dummy.txt",
58+
"log/webapp/dummy.txt",
59+
):
60+
storage_dirs.append(("storage/%s" % subdir, []))
5361

5462
webapp_content = defaultdict(list)
5563

56-
for root, dirs, files in os.walk('webapp/content'):
64+
for root, dirs, files in os.walk("webapp/content"):
5765
for filename in files:
5866
filepath = os.path.join(root, filename)
5967
webapp_content[root].append(filepath)
6068

61-
conf_files = [('conf', glob('conf/*.example'))]
62-
examples = [('examples', glob('examples/example-*'))]
69+
conf_files = [("conf", glob("conf/*.example"))]
70+
examples = [("examples", glob("examples/example-*"))]
6371

6472

6573
def read(fname):
@@ -70,60 +78,67 @@ def read(fname):
7078

7179
try:
7280
setup(
73-
name='graphite-web',
74-
version='1.2.0',
75-
url='http://graphiteapp.org/',
76-
author='Chris Davis',
77-
author_email='[email protected]',
78-
license='Apache Software License 2.0',
79-
description='Enterprise scalable realtime graphing',
80-
long_description=read('README.md'),
81-
long_description_content_type='text/markdown',
82-
package_dir={'' : 'webapp'},
83-
packages=[
84-
'graphite',
85-
'graphite.account',
86-
'graphite.account.migrations',
87-
'graphite.browser',
88-
'graphite.composer',
89-
'graphite.dashboard',
90-
'graphite.dashboard.migrations',
91-
'graphite.events',
92-
'graphite.events.migrations',
93-
'graphite.finders',
94-
'graphite.functions',
95-
'graphite.functions.custom',
96-
'graphite.metrics',
97-
'graphite.readers',
98-
'graphite.render',
99-
'graphite.tags',
100-
'graphite.tags.migrations',
101-
'graphite.url_shortener',
102-
'graphite.url_shortener.migrations',
103-
'graphite.version',
104-
'graphite.whitelist',
105-
'graphite.worker_pool',
106-
],
107-
package_data={'graphite': ['templates/*', 'local_settings.py.example']},
108-
scripts=glob('bin/*'),
109-
data_files=list(webapp_content.items()) + storage_dirs + conf_files + examples,
110-
install_requires=['Django>=4.2,<6', 'django-tagging', 'pytz',
111-
'pyparsing', 'cairocffi', 'urllib3', 'six'],
112-
classifiers=[
113-
'Intended Audience :: Developers',
114-
'Natural Language :: English',
115-
'License :: OSI Approved :: Apache Software License',
116-
'Programming Language :: Python',
117-
'Programming Language :: Python :: 3',
118-
'Programming Language :: Python :: 3.7',
119-
'Programming Language :: Python :: 3.8',
120-
'Programming Language :: Python :: 3.9',
121-
'Programming Language :: Python :: 3.10',
122-
'Programming Language :: Python :: Implementation :: CPython',
123-
'Programming Language :: Python :: Implementation :: PyPy',
124-
],
125-
**setup_kwargs
81+
name="graphite-web",
82+
version="1.2.0",
83+
url="http://graphiteapp.org/",
84+
author="Chris Davis",
85+
author_email="[email protected]",
86+
license="Apache Software License 2.0",
87+
description="Enterprise scalable realtime graphing",
88+
long_description=read("README.md"),
89+
long_description_content_type="text/markdown",
90+
package_dir={"": "webapp"},
91+
packages=[
92+
"graphite",
93+
"graphite.account",
94+
"graphite.account.migrations",
95+
"graphite.browser",
96+
"graphite.composer",
97+
"graphite.dashboard",
98+
"graphite.dashboard.migrations",
99+
"graphite.events",
100+
"graphite.events.migrations",
101+
"graphite.finders",
102+
"graphite.functions",
103+
"graphite.functions.custom",
104+
"graphite.metrics",
105+
"graphite.readers",
106+
"graphite.render",
107+
"graphite.tags",
108+
"graphite.tags.migrations",
109+
"graphite.url_shortener",
110+
"graphite.url_shortener.migrations",
111+
"graphite.version",
112+
"graphite.whitelist",
113+
"graphite.worker_pool",
114+
],
115+
package_data={"graphite": ["templates/*", "local_settings.py.example"]},
116+
scripts=glob("bin/*"),
117+
data_files=list(webapp_content.items()) + storage_dirs + conf_files + examples,
118+
install_requires=[
119+
"Django>=4.2,<6",
120+
"django-tagging",
121+
"pytz",
122+
"pyparsing",
123+
"cairocffi",
124+
"urllib3",
125+
"six",
126+
],
127+
classifiers=[
128+
"Intended Audience :: Developers",
129+
"Natural Language :: English",
130+
"License :: OSI Approved :: Apache Software License",
131+
"Programming Language :: Python",
132+
"Programming Language :: Python :: 3",
133+
"Programming Language :: Python :: 3.7",
134+
"Programming Language :: Python :: 3.8",
135+
"Programming Language :: Python :: 3.9",
136+
"Programming Language :: Python :: 3.10",
137+
"Programming Language :: Python :: Implementation :: CPython",
138+
"Programming Language :: Python :: Implementation :: PyPy",
139+
],
140+
**setup_kwargs
126141
)
127142
finally:
128-
with open('setup.cfg', 'w') as f:
143+
with open("setup.cfg", "w") as f:
129144
f.write(orig_setup_cfg)

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[gh-actions]
22
python =
3-
3.9: py39
43
3.10: py310
54
3.11: py311
65
3.12: py312
76
3.13: py313
87

98
[tox]
109
envlist =
11-
py{39,310,311,312,313},lint,docs
10+
py{310,311,312,313},lint,docs
1211

1312
[testenv]
1413
whitelist_externals =

0 commit comments

Comments
 (0)