Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit f579e95

Browse files
authored
# bug(1854406): Addressing installation problems affecting consumers of this repo. (#277)
* updated setup.py and explitly specifying dependencies versions + removed user_scm_version flag * Tweaked CI configuration to comment out any potential publishing steps * trying to fix CI build * fixing linting error * Tweaked CI configuration to comment out any potential publishing steps
1 parent 4ebd638 commit f579e95

3 files changed

Lines changed: 135 additions & 102 deletions

File tree

.circleci/config.yml

Lines changed: 99 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#######
2+
## 2023-11-07 update @kik:
3+
## Changes to the repo were needed to address bug[1854406]
4+
# However, we do not want to publish any artifacts anywhere
5+
# to avoid this CI steps with potential to publish artifacts were commented out.
6+
###
7+
18
####################
29
# CircleCI configuration reference:
310
# https://circleci.com/docs/2.0/configuration-reference
@@ -25,26 +32,27 @@ test_settings: &test_settings
2532
command: |
2633
# python-snappy compression relies on C bindings to libsnappy-dev.
2734
# pyspark needs to run Java, so we install openjdk.
28-
echo "deb [check-valid-until=no] http://cdn-fastly.deb.debian.org/debian jessie main" > /etc/apt/sources.list.d/jessie.list
29-
echo "deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list
30-
sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
35+
sed -i 's/^/#/' /etc/apt/sources.list
36+
echo "deb [check-valid-until=no] http://archive.debian.org/debian-archive/debian jessie main" >> /etc/apt/sources.list.d/jessie.list
37+
echo "deb [check-valid-until=no] http://archive.debian.org/debian-archive/debian jessie-backports main" >> /etc/apt/sources.list.d/jessie-backports.list
38+
# sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list
3139
apt-get -o Acquire::Check-Valid-Until=false update
32-
apt-get install -t jessie-backports -y libsnappy-dev openjdk-8-jre-headless
40+
apt-get install --force-yes -t jessie-backports -y libsnappy-dev openjdk-8-jre-headless
3341
/usr/sbin/update-java-alternatives -s java-1.8.0-openjdk-amd64
3442
- run: &run_tox_environment_matching_circleci_job_name
3543
name: Run tox job
3644
command: |
37-
pip install tox
45+
pip install tox==3.24.5
3846
tox -e $CIRCLE_JOB
39-
- run:
40-
name: Submit code coverage data
41-
command: |
42-
# Skip this step if running via the CircleCI local CLI.
43-
[ -z "$CIRCLE_BUILD_NUM" ] && exit 0
44-
# Activate the virtualenv so that codecov can find the 'coverage' executable.
45-
source .tox/$CIRCLE_JOB/bin/activate
46-
# Upload to codecov and flag (-F) with the name of the job.
47-
bash <(curl -s https://codecov.io/bash) -F $CIRCLE_JOB
47+
# - run:
48+
# name: Submit code coverage data
49+
# command: |
50+
# # Skip this step if running via the CircleCI local CLI.
51+
# [ -z "$CIRCLE_BUILD_NUM" ] && exit 0
52+
# # Activate the virtualenv so that codecov can find the 'coverage' executable.
53+
# source .tox/$CIRCLE_JOB/bin/activate
54+
# # Upload to codecov and flag (-F) with the name of the job.
55+
# bash <(curl -s https://codecov.io/bash) -F $CIRCLE_JOB
4856

4957

5058

@@ -73,44 +81,44 @@ jobs:
7381
docker:
7482
- image: python:3.7-jessie
7583

76-
docs: &docs_settings
77-
docker:
78-
- image: python:3.6-jessie
79-
steps:
80-
- checkout
81-
- run:
82-
<<: *install_packages
83-
- run:
84-
<<: *run_tox_environment_matching_circleci_job_name
85-
- persist_to_workspace:
86-
root: docs/_build
87-
paths: html
88-
89-
docs-deploy:
90-
docker:
91-
- image: node:8.10.0
92-
steps:
93-
- checkout
94-
- attach_workspace:
95-
at: docs/_build
96-
- run:
97-
name: Disable jekyll builds
98-
command: touch docs/_build/html/.nojekyll
99-
# Needed for write access to the GitHub repository;
100-
# see https://circleci.com/docs/2.0/gh-bb-integration/#deployment-keys-and-user-keys
101-
- add_ssh_keys:
102-
fingerprints:
103-
- "bb:e1:fa:08:e2:ff:a4:ed:f9:b0:64:c0:e6:07:0d:08"
104-
# The gh-pages npm package looks to be the most widely used utility for
105-
# pushing a directory to a git branch;
106-
# see https://www.npmjs.com/package/gh-pages
107-
- run:
108-
name: Deploy docs to gh-pages branch
109-
command: |
110-
git config user.email "fx-data-platform@mozilla.com"
111-
git config user.name "CircleCI docs-deploy job"
112-
npm install -g --silent gh-pages@2.0.1
113-
gh-pages --dotfiles --message "[skip ci] Updates" --dist docs/_build/html
84+
# docs: &docs_settings
85+
# docker:
86+
# - image: python:3.6-jessie
87+
# steps:
88+
# - checkout
89+
# - run:
90+
# <<: *install_packages
91+
# - run:
92+
# <<: *run_tox_environment_matching_circleci_job_name
93+
# - persist_to_workspace:
94+
# root: docs/_build
95+
# paths: html
96+
97+
# docs-deploy:
98+
# docker:
99+
# - image: node:8.10.0
100+
# steps:
101+
# - checkout
102+
# - attach_workspace:
103+
# at: docs/_build
104+
# - run:
105+
# name: Disable jekyll builds
106+
# command: touch docs/_build/html/.nojekyll
107+
# # Needed for write access to the GitHub repository;
108+
# # see https://circleci.com/docs/2.0/gh-bb-integration/#deployment-keys-and-user-keys
109+
# - add_ssh_keys:
110+
# fingerprints:
111+
# - "bb:e1:fa:08:e2:ff:a4:ed:f9:b0:64:c0:e6:07:0d:08"
112+
# # The gh-pages npm package looks to be the most widely used utility for
113+
# # pushing a directory to a git branch;
114+
# # see https://www.npmjs.com/package/gh-pages
115+
# - run:
116+
# name: Deploy docs to gh-pages branch
117+
# command: |
118+
# git config user.email "fx-data-platform@mozilla.com"
119+
# git config user.name "CircleCI docs-deploy job"
120+
# npm install -g --silent gh-pages@2.0.1
121+
# gh-pages --dotfiles --message "[skip ci] Updates" --dist docs/_build/html
114122

115123
lint:
116124
docker:
@@ -120,32 +128,32 @@ jobs:
120128
- run:
121129
name: Run tests
122130
command: |
123-
pip install flake8
131+
pip install flake8==3.9.1
124132
flake8 moztelemetry/ tests/
125133
126134
# Only runs when a tag starting with 'v' is place on the repository;
127135
# see the workflows section below for trigger logic.
128-
deploy:
129-
docker:
130-
- image: python:3.6
131-
steps:
132-
- checkout
133-
- run:
134-
name: Install deployment tools
135-
command: |
136-
pip install --upgrade setuptools wheel twine
137-
- run:
138-
name: Create the distribution files
139-
command: |
140-
python setup.py sdist bdist_wheel
141-
- run:
142-
name: Upload to PyPI
143-
command: |
144-
# Relies on the TWINE_USERNAME and TWINE_PASSWORD environment variables configured at:
145-
# https://circleci.com/gh/mozilla/python_moztelemetry/edit#env-vars
146-
# For more on twine, see:
147-
# https://twine.readthedocs.io/en/latest/
148-
twine upload dist/*
136+
# deploy:
137+
# docker:
138+
# - image: python:3.6
139+
# steps:
140+
# - checkout
141+
# - run:
142+
# name: Install deployment tools
143+
# command: |
144+
# pip install --upgrade setuptools wheel twine
145+
# - run:
146+
# name: Create the distribution files
147+
# command: |
148+
# python setup.py sdist bdist_wheel
149+
# - run:
150+
# name: Upload to PyPI
151+
# command: |
152+
# # Relies on the TWINE_USERNAME and TWINE_PASSWORD environment variables configured at:
153+
# # https://circleci.com/gh/mozilla/python_moztelemetry/edit#env-vars
154+
# # For more on twine, see:
155+
# # https://twine.readthedocs.io/en/latest/
156+
# twine upload dist/*
149157

150158

151159

@@ -159,21 +167,21 @@ workflows:
159167
jobs:
160168
- py35
161169
- py36
162-
- docs
170+
# - docs
163171
- lint
164-
- docs-deploy:
165-
requires:
166-
- docs
167-
filters:
168-
branches:
169-
only: master
170-
171-
tagged-deploy:
172-
jobs:
173-
- deploy:
174-
filters:
175-
branches:
176-
# Ignore all branches; this workflow should only run for tags.
177-
ignore: /.*/
178-
tags:
179-
only: /^v.*/
172+
# - docs-deploy:
173+
# requires:
174+
# - docs
175+
# filters:
176+
# branches:
177+
# only: master
178+
179+
# tagged-deploy:
180+
# jobs:
181+
# - deploy:
182+
# filters:
183+
# branches:
184+
# # Ignore all branches; this workflow should only run for tags.
185+
# ignore: /.*/
186+
# tags:
187+
# only: /^v.*/

moztelemetry/parse_scalars.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ def load_scalars(filename, strict_type_checks=True):
319319

320320
# Make sure that the category has at least one probe in it.
321321
if not category or len(category) == 0:
322-
raise ParserError('Category "{}" must have at least one probe in it' +
323-
'.\nSee: {}'.format(category_name, BASE_DOC_URL))
322+
raise ParserError(
323+
'''Category "{}" must have at least one probe in it.' \
324+
See: {}'''.format(category_name, BASE_DOC_URL))
324325

325326
for probe_name in category:
326327
# We found a scalar type. Go ahead and parse it.

setup.py

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,48 @@
66
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
77
from setuptools import setup, find_packages
88

9-
tests_require = ['mock', 'pytest-timeout', 'moto', 'responses',
10-
'scipy', 'pyspark', 'pytest', 'pytest-cov']
9+
tests_require = [
10+
'mock>=3.0.4,<=5.0.0',
11+
'pytest-timeout>=1.3.4,<=2.0.2',
12+
'moto>=2.2.15,<=2.2.20',
13+
'responses>=0.16.0,<=0.18.0',
14+
'scipy>=1.3.3,<=1.9.2',
15+
'pyspark>=2.2.3,<=3.2.4',
16+
'pytest>=5.3.1,<=6.2.4',
17+
'pytest-cov>2.6.0,<=2.8.0',
18+
'flake8>3.8.3,<=3.9.1',
19+
]
1120

1221
setup(
1322
name='python_moztelemetry',
14-
use_scm_version=True,
23+
# use_scm_version=True,
1524
author='Roberto Agostino Vitillo',
1625
author_email='rvitillo@mozilla.com',
1726
description='Spark bindings for Mozilla Telemetry',
1827
url='https://github.com/mozilla/python_moztelemetry',
1928
packages=find_packages(),
2029
package_dir={'moztelemetry': 'moztelemetry'},
21-
install_requires=['boto', 'boto3', 'ujson', 'requests',
22-
'protobuf>=3.6.0', 'six',
23-
'expiringdict', "functools32;python_version<'3'", 'py4j',
24-
'pandas>=0.19.2', 'numpy>=1.8.2',
25-
'PyYAML', 'python-snappy'],
26-
setup_requires=['pytest-runner', 'setuptools_scm'],
30+
install_requires=[
31+
'boto<=2.49.0',
32+
'boto3<=1.28.57',
33+
'ujson>=3.2.0,<=5.5.0',
34+
'requests>2.24.0,<=2.31.0',
35+
'protobuf>=3.17.3,<=3.19.6',
36+
'six==1.12',
37+
'expiringdict==1.2.2',
38+
"functools32;python_version<'3'",
39+
'py4j>=0.10.9.4,<=0.10.9.7',
40+
'pandas>=0.19.2',
41+
'numpy>=1.18.5,<=1.21.6',
42+
'PyYAML==5.1.2',
43+
'python-snappy>=0.5.4,<=0.6.0',
44+
'urllib3<1.27,>=1.25.4',
45+
'typed-ast<1.5,>=1.4.0'
46+
],
47+
setup_requires=[
48+
'pytest-runner>=5.2,<=5.3.2',
49+
'setuptools_scm>=4.1.2,<=7.0.5'
50+
],
2751
extras_require={
2852
'testing': tests_require,
2953
},

0 commit comments

Comments
 (0)