file-icons / atom

Atom file-specific icons for improved visual grepping.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fix and update requirements.txt

netsandbox opened this issue · comments

requirements.txtwas associated with binder in ec7beaa,
which I think is wrong, because requirements.txt is primary used for installing packages from pypi:
https://pip.pypa.io/en/latest/user_guide/#requirements-files

There is already a definition for requirements.in:

atom/config.cson

Lines 5313 to 5317 in 27284bb

PyPi:
icon: "pypi"
match: /^requirements\.in$/i
colour: "dark-blue"
priority: 2

["pypi-icon",["dark-blue","dark-blue"],/^requirements\.in$/i,2],

which points to pypi, which should be extended to apply also for other requirements file names.

I have seen the following requirements file names:

  • requirements-dev.txt
  • requirements-doc.txt
  • requirements_docs.txt
  • requirements-test.txt
  • requirements_test.txt

So maybe the match can be adjusted to also catch these file names. Something like:
/^(dev-)?requirements.*\.(in|txt)$/

👋 Hey mate, sorry for the slow response.

Aye, when I was addressing file-icons/icons#82, I didn't think to check if requirements.txt already had an icon associated with it (other than the normal text-file icon, that is). It also doesn't help that I have very little exposure to Python culture, and I'm pretty much blind to established project conventions. 😅

So maybe the match can be adjusted to also catch these file names. Something like:
/^(dev-)?requirements.*\.(in|txt)$/

Is the dev- prefix set in stone? Or is a purely user-defined label? If it's the latter, then wouldn't this be more accurate…?

match: ///
	^
	( (dev|docs?|tests?) [-_] requirements
	| requirements ([-_] (dev|docs?|tests?))?
	) \.(in|txt)$
///i

Also, how exactly does PyPi determine which filename variation to use when it runs? Is it specified in another manifest?

Actually PyPi just mention the filename requirements.txt.
As you run the pip install command with the -r, --requirement <file> option you can use as filename whatever you want.
It is hard to make everyone happy and for sure you can only support the widely used filenames for requirements file.
So I'm quite happy with your suggested match 👍 .

And by the way, thanks for this package, which makes our developer life happier 😄 .

Ah, right. Well in that case, this is probably overkill—and should anybody request another variation of requirements.txt, I'll direct them to this discussion to justify the line I've drawn in the sand.

Now, I've fixed this, but it might be a while before it lands in the next release. The project is halfway through a non-trivial migration towards a more streamlined pipeline and release process. One that's long overdue, might I add…

(Oh, and thanks for the kind words! 😀 It really does mean a lot—I love hearing that something I made managed to brighten somebody's day a bit.)