Should I pin my Python dependencies versions?

The reason the two other answers contradict each other is that they’re both right (and worth reading), but they apply to different situations. If you’re releasing a library on PyPI, you should declare whatever dependencies you know about, but not pin to a specific version. For example, if you know you need >= 1.2, but … Read more

How to exclude dependency in a Maven plugin?

Here is an example where the jetty-maven-plugin has a dependency on jtidy replaced with a newer version: http://jira.codehaus.org/browse/JETTY-1339?focusedCommentId=257747&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_257747 <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <dependencies> <dependency> <groupId>net.sf.jtidy</groupId> <artifactId>jtidy</artifactId> <version>r938</version> </dependency> <dependency> <groupId>org.apache.maven.plugin-tools</groupId> <artifactId>maven-plugin-tools-api</artifactId> <version>2.5.1</version> <exclusions> <exclusion> <groupId>jetty</groupId> <artifactId>jetty</artifactId> </exclusion> </exclusions> </dependency> </dependencies> […] </plugin>

is it possible to disable javac’s inlining of static final variables?

Item 93 of Java Puzzlers (Joshua Bloch) says that you can work round this by preventing the final value from being considered a constant. For example: public class A { public static final int INT_VALUE = Integer.valueOf(1000).intValue(); public static final String STRING_VALUE = “foo”.toString(); } Of course none of this is relevant if you don’t … Read more

Optional dependencies in a pip requirements file

Instead of specifying optional dependencies in the same file as the hard requirements, you can create a optional-requirements.txt and a requirements.txt. To export your current environment’s packages into a text file, you can do this: pip freeze > requirements.txt If necessary, modify the contents of the requirements.txt to accurately represent your project’s dependencies. Then, to … Read more

How to specify ansible pretasks for a role?

I use the pre_tasks to do some tasks before roles, thanks for Kashyap. #!/usr/bin/env ansible-playbook — – hosts: all become: true pre_tasks: – name: start tasks and sent notifiaction to HipChat hipchat: color: purple token: “{{ hipchat_token }}” room: “{{ hipchat_room }}” msg: “[Start] Run ‘foo/setup.yml’ playbook on {{ ansible_nodename }}.” roles: – chusiang.vim-and-vi-mode vars: … Read more

Don’t include dependencies from packages.config file when creating NuGet package

In version 2.7 there is an option called developmentDependency that can be set into package.config to avoid including dependency. <?xml version=”1.0″ encoding=”utf-8″?> <packages> <package id=”jQuery” version=”1.5.2″ /> <package id=”netfx-Guard” version=”1.3.3.2″ developmentDependency=”true” /> <package id=”microsoft-web-helpers” version=”1.15″ /> </packages>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)