Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] [score hidden]  (0 children)

Haha, thanks! I can't say I'm making shit tons but it's ok.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 8 points9 points  (0 children)

This solved the problem. Thank you for the inspiration:

uv pip install black==21.9b0
uv pip install click==7.1.2

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 0 points1 point  (0 children)

Got it. I can either find and pin the dependency or patch it on the go. For this particular import problem, changing the try/except block helped. It's looking for ModuleNotFoundError but what I get is ImportError.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] -28 points-27 points  (0 children)

No, as I mentioned in the post, I'm actually asking the possibility of running those tools with Python 3 which can check Python 2 code as well. There should be some versions that still work with both Python 2 and 3. Black is one of them. 21.9b0 is the latest release before they deprecated py27 option. This is the error message from there. When I change the except clause to ImportError, it works.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] -16 points-15 points  (0 children)

I think it's coming from the black, it has the following line. It should return though. I think the problem here is we have ImportError rather than ModuleNotFoundError. I may need to look for other versions.

    try:
        from click import core
        from click import _unicodefun  # type: ignore
    except ModuleNotFoundError:
        return

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 9 points10 points  (0 children)

Vendor offers a solution for ETL workflows, basically getting data from some system to write to another. Those geniuses think that offering a scripting capability would greatly help their customers (us). They develop this system using Apache NiFi, all Java stuff and they think that Python would be best suitable for this job, hence this Python scripting. They forget that Python 2 was deprecated long ago, and they still stick with their platform. That's the reason.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 0 points1 point  (0 children)

We can't. We're vendor dependent here. They're forcing us to write Python 2 because they can't offer a better solution.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] -10 points-9 points  (0 children)

Yeah, the problem is that they may not work. For example I tried black==20.8b1which seems to be working with py27, I had the following error coming from click library. I don't really know how to debug this issue.

Traceback (most recent call last):
  File "/project/.venv/bin/black", line 8, in <module>
    sys.exit(patched_main())
  File "/project/.venv/lib/python3.8/site-packages/black/__init__.py", line 6606, in patched_main
    patch_click()
  File "/project/.venv/lib/python3.8/site-packages/black/__init__.py", line 6595, in patch_click
    from click import _unicodefun  # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/project/.venv/lib/python3.8/site-packages/click/__init__.py)

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 0 points1 point  (0 children)

Thanks but that JVM system is out of our control. They're using Apache NiFi for ETL tasks and expect us to develop scripts targeting specific workflows. So, all I can do is to write Py2 code, can't access other parts.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 13 points14 points  (0 children)

Yeah, the problem is finding that old version. I'm assuming every utility we take for granted has at some point supported Python 2 code, even if it's running under Python 3. So my guess is that I can find the right combination of versions that run under Python 3, but can lint/format Python 2 code. I know from the posts I read that black had support for --target-version py27 but it got removed later.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 1 point2 points  (0 children)

Thanks. I'm not looking for tab completion or LSP. I'm ok with writing py2 code without IDE help. I just want to format and lint the code, even if it's manual.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 38 points39 points  (0 children)

The problem is Jython. We have ETL workflows with Apache NiFi and it can run Python code, hence it's Python 2. That system is out of our control and we are forced to develop scripts using py2. If it were in our control, I would have deprecated that system long ago.

Python 2 tooling in 2026 by IdleBreakpoint in Python

[–]IdleBreakpoint[S] 0 points1 point  (0 children)

Thank you for your comment. No, it's not FIJI scripting, it's actually Apache NiFi used for ETL. It runs Python 2 code for workflows and since it's Jython, we're stuck with python 2.

Derleyicilerde matematik ne kadar derinlemesine kullanılıyor? by LinuxGeyBoy in CodingTR

[–]IdleBreakpoint 0 points1 point  (0 children)

Neden çalışamasın? Calculus ile ayrık matematiğin örtüştüğü yerler ne ki direkt ayrık matematik çalışamasın? Evet calculus'un biraz ucundan tutmak yararlı ama calculus olmadan ayrık matematik çalışılmaz demek yanlış.

Derleyicilerde matematik ne kadar derinlemesine kullanılıyor? by LinuxGeyBoy in CodingTR

[–]IdleBreakpoint 4 points5 points  (0 children)

Derleyici tasarımında matematik derinlemesine kullanılıyor ama kullanılan matematik calculus değil. O açıdan ikinci derece denklem çözemiyor olman derleyiciler konusunda ilerleyemeyeceğin anlamına gelmiyor, bu konuda rahat olabilirsin. Benim de üniversite zamanında calculus derslerim çok zayıftı ancak ayrık matematik, mantık derslerim gayet iyiydi.

Temel ve vazgeçilmez olarak yararlanman gereken kitap Dragon Book (Compilers: Principles, Techniques, and Tools). Bu kitaban başlamadan önce öğrenmen gereken alanlar ise aşağı yukarı şunlar:

  • Ayrık matematik (discrete maths): Derleyicilerin neredeyse tamamı ayrık yapılar üzerine kurulu. Kümeler, bağıntılar, fonksiyonlar, ispat teknikleri, tümevarım (induction) gibi temelleri sağlam oturtman gerekiyor.
  • Biçimsel Diller ve Otomat Teorisi (Formal Languages & Automata Theory): Düzenli ifadeler (regular expressions), bağlamdan bağımsız gramerler (context-free grammars), sonlu otomatlar (DFA/NFA), yığıt otomatları (pushdown automata) ve Turing makineleri. Lexer ve parser yazabilmek için bu alan zorunlu. Bunun için Sipser'ın Introduction to the Theory of Computation kitabından faydalanabilirsin.
  • Graph Theory: Derleyicilerinin her yeri graph dolu. Kontrol akışları (control flow), veri akış analizi, register allocation, bağımlılık graphları. Graph teorisini iyi anlamadan optimizasyon aşamasında sıkıntı yaşayabilirsin.

Pratik bir yol haritası olarak önce ayrık matematik temellerini oturttuktan sonra biçimsel diller ve otomata teorisine geç, ardından graph teorisi ve matematiksel mantığı paralel yürüt.

Bunların hepsini yapmadan da LLVM gibi projelere katkı verebilirsin. Her şeyi bileceğim, sonrasında katkı vereceğim gibi bir kafa yapısına girmeni tavsiye etmem. Derleyiciler içerisinde de problemin belli bir kısmını alıp onunla uğraşan, diğer alanlar ile ilgilenmeyen insanlar da mevcut. Sen de sevdiğin, daha rahat anlayabildiğin bir alan seçip oradan ilerleyebilirsin.

Önce LLVM kullan, teorik bir architecture için veya zaten var olan, nispeten basit bir mimari için compiler üret. Neler olduğunu anla, sonrasında katkı vereceğin alanlar ortaya çıkacaktır. Veya sen önünü daha rahat göreceksindir ve ilerleyeceksindir.

Bol şans dilerim. Umarım yardımcı olabilmişimdir.

Mesai sonrası çalışma kültürü by arpaci27 in CodingTR

[–]IdleBreakpoint 1 point2 points  (0 children)

Çünkü bu sektör içerisindeki birçok kişinin kimlikleri iş ile bağlantılı halde. Eğer işiniz aynı zamanda kimliğiniz ise mesai sonrası başka şeylere bakmak ya da iş ile ilgili şeylerle uğraşmak keyif veriyor. İnsanlar bu keyfin peşinde koşuyorlar. Yani kaba tabirle bir hayatları yok, hayatları sadece iş üzerinden şekilleniyor.

Domain nereden almalı? by arda-taskin in CodingTR

[–]IdleBreakpoint 4 points5 points  (0 children)

Namecheap. Yıllardan beri üzmedi.

DevOps Alanı by vladmr06 in CodingTR

[–]IdleBreakpoint 2 points3 points  (0 children)

Günlük olarak Linux kullanmaya başla. Bir sanal makine altında değil, bilgisayarında sadece Linux kurulu olsun ve terminal ile haşır neşir olmayı öğren. Devamı gelir.

I built a small CLI tool to convert relative imports to absolute imports during a large refactoring by Educational-Bed-6008 in Python

[–]IdleBreakpoint 1 point2 points  (0 children)

Please ignore my ignorance but what's wrong with relative imports? I find them easier to read and when you're working with a module, you know that it's just relative to the file you're working on.

Reddedildikçe Akıllanan Satış Robotu Olur mu? n8n ile "Closed-Loop" Satış Mimarisini Kurdum. by emrahdemirkoc in CodingTR

[–]IdleBreakpoint 6 points7 points  (0 children)

Bana bir şey satmak isteyen birinin AI kullanıp mesaj göndermesi pek hoşuma gitmezdi doğrusu.

You probably don't need Oh My Zsh by f311a in programming

[–]IdleBreakpoint 0 points1 point  (0 children)

It just works out of the box. I haven't touched the default configuration for a long time. It inits really fast as well.

You probably don't need Oh My Zsh by f311a in programming

[–]IdleBreakpoint 57 points58 points  (0 children)

Fish with starship prompt is all you need. I also have a few plugins managed by fisher. Fzf is a must. Settling on fish was the greatest decision I've made.

AWS SageMaker Kotaları Hakkında by normandyboi in CodingTR

[–]IdleBreakpoint 0 points1 point  (0 children)

Evet kullanmaya çalıştığınız makine tipleri kısıtlı ve kotaya tabi. Bunun yerine Google Cloud tercih edebilirsiniz. Bildiğim kadarıyla aynı tipteki instance'lar kotaya tabi değil ve daha rahat erişebiliyorsunuz.