You don't necessarily. The key phrase here is "redistributions of source code".
Redistributing Source
You're redistributing the source code if you take the library's code, copy it into your project (maybe in its own directory or package), and publish your project's code. Git submodules are a good example of this - having a Git submodule in your public GitHub project is a redistribution of source code.
If this is what you're doing, then you must leave any licenses in the library's code untouched. This includes license files (LICENSE
, LICENSE.txt
, LICENSE.md
etc) as well as notices in source files.
This does not apply if you're only redistributing binaries of the library, such as DLLs or executables. These are object code, not source code, so they don't count as source redistribution and you don't have to leave the copyright notice. There may, however, be other requirements surrounding distribution of object form - check the full license.
Not Redistributing Source
If you're not redistributing the code of the library (for example, your code depends on the library but specifies its dependency in a requirements file - pip
's requirements.txt
convention or a Gemfile
are good examples of this), then you don't have to follow the requirements above. Including a kickback to the library is still a good thing to do, though, especially if it's a major part of your project. You're free to choose the format of this, though a link in your README is a pretty widespread method.