question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Consider removing the faker dependency

See original GitHub issue

The problem

faker uses 7.6M of disk as of writing. For users who aren’t using its features, this is a pretty heavy cost.

It includes a generator for license plates, SSN, ISBN, etc…

Proposed solution

Consider removing the faker dependency, allowing users to plug it if they need it.

This solution would also allow users to control how the faker factory is used and specify its locale, for instance.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

4reactions
charlaxcommented, Aug 1, 2019

I would argue that removing faker is a strictly better design, applying the single responsibility principle. Factoryboy already has a lot of value without using faker at all. This would add a lot of flexibility in choosing how fake values are generated.

But sure, this would definitely be a breaking change. I think this is achievable using setuptools extras, and would only require users to change the package they install without changing any code.

On Thu 1 Aug 2019 at 11:57, Raphaël Barrois notifications@github.com wrote:

I’ll try to sum up the current situation:

  • Faker takes (currently) 11MB of disk space
  • For comparison, an empty virtualenv is already 14MB in size (due to the copies of pip and setuptools there).

What is the actual issue here? factory_boy is intended as a development tool. It’s obviously better to reduce the size when possible, but are those 11MB a problem in development platforms?

If we want to reduce the space used by factory_boy, I see 2 options:

  • Find a way to reduce faker’s disk space (for instance by changing the way its provider data is stored, and maybe compressing it; or by making part of the contents optional);
  • Provide a way not to install faker alongside factory_boy.

Currently, factory_boy has a hard dependency on faker; making that optional would require every user of factory_boy+faker to change from factory_boy to factory_boy[faker] in their dependencies… which I’d rather avoid. Another option would be to publish two releases (factory_boy & factory_boy_minimal)?

All that is quite a lot of work for the project team and possibly for end users.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FactoryBoy/factory_boy/issues/632?email_source=notifications&email_token=AAA5NNPG6XCYGBKG67I52J3QCKXSDA5CNFSM4H3FWEDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3KBOCA#issuecomment-517216008, or mute the thread https://github.com/notifications/unsubscribe-auth/AAA5NNMVUTIRMVBHW6UQ7PTQCKXSDANCNFSM4H3FWEDA .

3reactions
rbarroiscommented, Aug 1, 2019

I’ll try to sum up the current situation:

  • Faker takes (currently) 11MB of disk space
  • For comparison, an empty virtualenv is already 14MB in size (due to the copies of pip and setuptools there).

What is the actual issue here? factory_boy is intended as a development tool. It’s obviously better to reduce the size when possible, but are those 11MB a problem in development platforms?

If we want to reduce the space used by factory_boy, I see 2 options:

  • Find a way to reduce faker’s disk space (for instance by changing the way its provider data is stored, and maybe compressing it; or by making part of the contents optional);
  • Provide a way not to install faker alongside factory_boy.

Currently, factory_boy has a hard dependency on faker; making that optional would require every user of factory_boy+faker to change from factory_boy to factory_boy[faker] in their dependencies… which I’d rather avoid. Another option would be to publish two releases (factory_boy & factory_boy_minimal)?

All that is quite a lot of work for the project team and possibly for end users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The npm faker package and the unexpected demise of open ...
The new 6.6.6 version completely removed all traces of the original source code of the Faker.js npm package. Any new installs of this...
Read more >
The right to delete: how faker.js exposed ... - The Ginger Viking
When the author of faker.js decided to delete his entire repository, it caused thousands of other codebases to break.
Read more >
cannot find module faker after npm install --save-dev
Following the answer of akop below, the safest way seems to switch to faker-js yarn remove faker yarn add --dev @faker-js/faker.
Read more >
The right to delete: how faker.js exposed the fragile ... - Reddit
Pulling down your dependencies should be a completely different process from building, and pulling down those dependencies should *always* be ...
Read more >
Dev corrupts NPM libs 'colors' and 'faker' breaking thousands ...
Users of popular open-source libraries 'colors' and 'faker' were left ... "Removing your own code from [GitHub] is a violation of their ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found