Hi, I am trying to upgrade to pants `2.11` from `1...
# general
f
Hi, I am trying to upgrade to pants
2.11
from
1.30
. I got a lot of errors like this:
Copy code
Name 'python_library' is not defined.
What should I change them to?
w
That's a pretty big jump - have you looked at this? https://www.pantsbuild.org/docs/upgrade-tips I think
python_library
turned into
python_sources
- but maybe it's safer to take a read through the upgrade tips, and even going so far back as the upgrade tips from 1.30 -> 2.0 https://www.pantsbuild.org/v2.0/docs/how-to-upgrade-pants-2-0
f
Yep but some people suggested me directly jump to 2.11, and I don’t see any instruction about how to update the python_library in that page.
w
Personally, I would go from 1.30 to 2.0.0 and then jump a bunch of versions at a time
f
Ok! I will try that.
I got this now:
Copy code
MappingError: Failed to parse xxx/xxx/BUILD:
__call__() got an unexpected keyword argument 'name'
Is this about
python_requirement_library
?
h
yeah, that can't have
name=
but it shouldnt if youre on 1.30
that's awesome you got to 1.30!!! so close to v2 🙌
f
Thx! It’s a long journey… I’m almost there… Still need helps from you guys
You mean in 1.30 it has already not accepted
name
? but when I ran
./pants filedeps :: > /dev/null
on
1.30
, it didn’t complain anything.
h
yeah,
name
only works w/ 2/10+. It sounds like you partially were trying to use 2.11. I recommend going back to your stable 1.30 branch, and starting the 2.0 upgrade from there without the changes from 2.11
h
I was the person who recommended going from 1.30 to 2.11, just because 1.30->2 is already a big leap, so why not just leap all the way there.
Going one at a time from 2.0 to 2.11 seems unnecessary?
Maybe I was giving bad advice...
f
Lol. Don’t be. You help me a lot.
I think I kind of successfully upgrade to 2.0, but I have jvm and thrift in my project, so I have to ignore those files for now. @hundreds-father-404 It seems that the
name
issue happen when I upgrade from 2.0 to 2.1
h
Benjy, if you want to keep old build files still working, that is too big of a jump
@hundreds-father-404 It seems that the name issue happen when I upgrade from 2.0 to 2.1
Hm, so are you able to get 2.0 working well? That would be probably good to land as a PR so that you have a baseline
you're getting this?
Copy code
MappingError: Failed to parse xxx/xxx/BUILD:
__call__() got an unexpected keyword argument 'name'
If you are able to share the build file, it might be easier to help
f
Good news. I have already made it to 2.10
❤️ 1
🙌 1
Now I have to deal with jvm, scala, and thrift
h
I don't think it's necessarily desirable to keep old BUILD files working, for example, you can delete (almost) all your
dependencies=
now...
And it may be easier to let
./pants tailor
generate BUILD files for you
(this was a reply to Eric)
That is good news! Note that Pants 2.x infer dependencies automatically from your import statements, so you can remove a lot of explicit
dependencies
from your BUILD files
1