I'm looking to upgrade a repo from an ancient 1.6....
# general
b
I'm looking to upgrade a repo from an ancient 1.6.0 version of pants to ideally the newest 2.x version of pants, so first I'm trying to go through 1.30.4 per the guidance here, any clue why this error will crop up when I upgrade to 1.30.4?
Copy code
$ ./pants test.pytest src/test/python::
New python executable in /Users/bmahler/.cache/pants/setup/bootstrap-Darwin-arm64/pants.95cc9e/install/bin/python2.7
Also creating executable in /Users/bmahler/.cache/pants/setup/bootstrap-Darwin-arm64/pants.95cc9e/install/bin/python
Installing setuptools, pip, wheel...done.
Looking in links: <redacted>, <redacted>
Collecting pantsbuild.pants==1.30.4
  Downloading <redacted>/pantsbuild.pants-1.30.4.tar.gz (4.8MB)
    100% |████████████████████████████████| 4.8MB 8.4MB/s
  Installing build dependencies ... done
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    IOError: [Errno 2] No such file or directory: '/private/var/folders/hj/4zbxnmpd4nx174gsg9ly4lpr0000gn/T/pip-install-6nrE5f/pantsbuild.pants/setup.py'
h
1.30.x itself is very ancient at this point, so there be tygers... But that said, I notice that you're running on Python 2.7. I recommend trying on 3.7.
b
ok great, that gets it further along, but it fails at:
Copy code
ERROR: Could not find a version that satisfies the requirement pantsbuild.pants.contrib.python.checks==1.30.4 (from versions: 0.0.76, 0.0.80, 1.1.0rc6, 1.1.0rc7, 1.2.0.dev11, 1.2.0rc0, 1.3.0.dev0, 1.3.0.dev3, 1.3.0rc1, 1.4.0.dev23, 1.4.0.dev24, 1.4.0.dev26, 1.6.0)
ERROR: No matching distribution found for pantsbuild.pants.contrib.python.checks==1.30.4
I don't see a release in pypi that I can upload into our private repository: https://pypi.org/project/pantsbuild.pants.contrib.python.checks/#history the latest there is 1.29.0?
removed the pantsbuild.pants.contrib.python.checks plugin from the pants.ini, and got further:
Copy code
18:47:49 [INFO] pantsd initialized.
18:47:49 [ERROR] Invalid option 'build_file_imports' under [GLOBAL] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid option 'fast' under [test.pytest] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [lint.python-eval] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-import-order] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-pep8] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-pyflakes] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-context-manager] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-except-statement] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-future-compat] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-indentation] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-newlines] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-print-statements] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-variable-names] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-newstyle-classes] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-trailing-whitespace] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid scope [pycheck-class-factoring] in /Users/bmahler/git/aurora/pants.ini
18:47:49 [ERROR] Invalid config entries detected. See log for details on which entries to update or remove.
(Specify --no-verify-config to disable this check.)
h
Yeah, this makes sense - you'll have to edit your config file to be compatible with 1.30.4. Those options/sections mentioned are I guess not available in that version any more.
b
I ended up commenting all of them out since I couldn't find what the equivalents would be, do you have a good doc? removing them all gets further:
Copy code
MappingError: Failed to parse src/test/python/apache/thermos/observer/BUILD:
NameError("name 'globs' is not defined")
from:
Copy code
python_tests(
  name = 'observer',
  sources = globs('*.py'),
  dependencies = [
    '3rdparty/python:mock',
    'src/main/python/apache/thermos/monitoring',
    'src/main/python/apache/thermos/observer',
  ]
)
seems like this is the new way: https://v1.pantsbuild.org/globs.html