bencode.py | Simple bencode parser
kandi X-RAY | bencode.py Summary
kandi X-RAY | bencode.py Summary
Simple bencode parser (for Python 2, Python 3 and PyPy)
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bencode.py
bencode.py Key Features
bencode.py Examples and Code Snippets
Community Discussions
Trending Discussions on bencode.py
QUESTION
How does stack resolve dependecy conflicts?
I just started off with Haskell and I have few questions on how stack resolves dependencies.
Let's say my project requires
lib A
andlib B
.Internally,
lib A
requireslib X-1.9.0
andlib B
requireslib X-2.0.0
, how would stack resolve this?stack documentation says they use snapshots to resolve conflicts, how does that work? Does it mean authors of lib A and lib B decide on a version of lib X which works with both of them? If so, what happens when I use a newer version of lib A or lib B or if either of them are not in the snapshots?
How are snapshots actually made?
Stack by default installs packages globally. What happens when a Project A requires lib Y-1.0 and Project B requries lib Y-1.1? How does this gets taken care of?
How does one use packages at "stackage.org"?
I was trying to install
beam-core
and google took me to https://www.stackage.org/package/beam-core where there's no mention of the command which installs it or what is the latest version. I could not find the version number anywhere expect in github releases.With both pip and npm, it's quite straight forward and all the information on how to install and use is available on package's page. For example both,
https://pypi.org/project/bencode.py/
https://www.npmjs.com/package/projects
contains version number and install command, even though they are quite obvious.
I often get errors related to 'stack-configuration' when I try to install a package. I don't what 'stack-configuration' is? What does all these errors mean and how to resolve them in context with all the above questions?
Performing stack install beam-core
or stack repl --package beam-core --package beam-sqlite --package sqlite-simple --package beam-migrate --package text
results in
ANSWER
Answered 2020-Mar-12 at 21:06For question #1:
Stack is designed around the concept that, for a given Stack project, only one version of a given package will be used. So, if you have a project that requires libraries A
and B
, and each of them depend on different versions of library X
, then you cannot build your project as-is with Stack.
Snapshots are constructed by building collections of versions of packages (with exactly one version per package) such that all inter-package dependencies can be satisfied. This is done by the Stackage "curators" as described here using the curator
tool. The curator
tool uses the index of packages available on Hackage to construct a set of versions of packages (exactly one version per package) that are compatible in the sense that all package interdependencies are satisfied.
So, the library authors don't need to decide on a version of X
that works with both. Rather, they need to specify a range of versions of X
that their package works with, and the curator
tool selects the most recent version of X
that works with both their packages, as well as everyone else's packages that depend on X
or on which X
has a dependency.
If you want to use a newer version of library A
or B
that isn't in the snapshot, you add it as an extra dependency in your build plan (i.e., in the extra-deps
section of your stack.yaml
file). If the new version can't be built with the snapshot's version of X
, you need to add an extra dependency for X
too. If that breaks other packages and you can't find a set of extra dependencies that resolves all conflicts, you're out of luck.
In practice, because most packages have relatively generous ranges of dependencies and, for actively maintained packages, those ranges are generally kept up to date with newer compatible dependency versions, you don't often run into unresolvable conflicts, but it does happen.
For question #2:
Stack doesn't really install packages globally. It installs snapshot packages in a global cache (on Linux, in the directory ~/.stack
) organized by snapshot. So, multiple versions can be installed in this cache under different snapshots, and the project will use whichever version is appropriate for the project's selected snapshot.
For question #3:
On the Stackage page for beam-core
, you can see that the most recent LTS snapshot that contains it is lts-14.27
. You can create a new project using this resolver with:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bencode.py
No Installation instructions are available at this moment for bencode.py.Refer to component home page for details.
Support
If you have any questions vist the community on GitHub, Stack Overflow.
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page