-
Notifications
You must be signed in to change notification settings - Fork 96
Consider creating a semver package #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
+1 as it will also reduce the possibility of having conflicts. But maybe we should consider this for a 3.0.0 release |
I believe that the pros here really outweigh the cons:
A well named file will contain relevant functions, therefore narrows down where you could possibly find a function related to a specific feature.
Relative imports still work when breaking up a module into a package. I would give this a +2 if I could since the |
That is an interesting question 🤔 ... From my personal experience, most python packages I've worked with tend to have a Out of familiarity, I would be tempted to go with the former for the usual pro: it is easier to exclude test code collecting files for packaging. |
In theory yes. But not everybody uses IDEs.
Right.
Yes, that would probably help to focus and consolidate. |
You are right, test frameworks can discover tests almost anywhere. From a technical side, it doesn't matter where they are. It's probably a matter of taste.
Exactly. I prefer a separate |
Looking at the current direction the project is taking, I think we will have 2 files:
Seeing that most module level functions are now being deprecated, I think this layout will be clear and it shouldn't be too hard to search for a functionality. |
Depends how we count it. 😉 If we count the
Yes, I think so too. If it turns out we should keep one or two module level functions, we could create a third file. |
This is now integrated in #306 |
Uh oh!
There was an error while loading. Please reload this page.
Definitions
A module is a file containing Python definitions and statements.
A package is a collection of modules in directories that give a package hierarchy.
Situation
The current
semver.py
module contains almost 800 lines of code. As new functionality is added, the files grows bigger and bigger.Suggested Solution
Should we consider to refactor the semver module into a package?
If yes, this is a feature which we should introduce for the upcoming 3.0.0 release. Could we label that in GitHub as such (or create a milestone)? 😉
Maybe we should also consider to refactor our test cases too and move them to a
tests/
directory and create different files? They are currently almost 700 lines of code.That issue involves the following actions:
tests/
directory?An example (although a bit outdated now as new commits arrived in master) can be viewed in
my fork). It's not perfect, but a start.
Pros
__main__.py
, it is possible to usepython -m semver -h
Cons
tox
first or create a virtual environment.What do you think? 😉
The text was updated successfully, but these errors were encountered: